the pipeline actually loads the model twice, once in the get_framework function and then again on line 3296
  
      github.com
  
  
    huggingface/transformers/blob/master/src/transformers/pipelines.py#L3296 6

    logger.warning(        "Model might be a PyTorch model (ending with `.bin`) but PyTorch is not available. "        "Trying to load the model with Tensorflow."    )if model_class is None:    raise ValueError(        f"Pipeline using {framework} framework, but this framework is not supported by this pipeline."    )model = model_class.from_pretrained(model, config=config, revision=revision, **model_kwargs)if task == "translation" and model.config.task_specific_params:    for key in model.config.task_specific_params:        if key.startswith("translation"):            task = key            warnings.warn(                '"translation" task was used, instead of "translation_XX_to_YY", defaulting to "{}"'.format(                    task                ),                UserWarning,            )



  
  
    
    
  
  


For now, if you want, you could just hardcode the framework as pt  and remove the call to get_framework to load the model once.