Check if Product is in a Specific Category in Functions.php

Add your conditional to your function, instead of wrapping the hook and function. I’m pretty sure you’ll need to pass the post ID because this may not be running in the loop??? (check me on that). You can forgo the is_product() check inside the function as well since the hook is only triggered by woocommerce.

function woo_new_product_tab( $tabs ) {
global $post;
if ( has_term( 'Models', 'product_cat', $post->ID ) ) {

    // Adds a compare tab
    $tabs['compare'] = array(
    'title'     => __( 'Compare', 'woocommerce' ),
    'id' => 'compare',
    'priority'  => 50,
    'callback'  => 'woo_compare_tab_content'
    );
    // Adds a warranty tab
    $tabs['warranty'] = array(
    'title'     => __( 'Warranty', 'woocommerce' ),
    'id' => 'warranty',
    'priority'  => 50,
    'callback'  => 'woo_warranty_tab_content'
    );

}
return $tabs;
}

You’ll find some more explanation here: https://bloke.org/wordpress/conditional-woocommerce-product-tabs/