"docs/vscode:/vscode.git/clone" did not exist on "22a0dd2ef754676ede6009cd8e86b10b053ac2cc"
Unverified Commit ee5b2457 authored by Ben Nimmo's avatar Ben Nimmo Committed by GitHub
Browse files

the use_auth_token has not been set up early enough in the model_kwargs. Fixes #12941 (#13205)

parent 03056730
......@@ -410,6 +410,9 @@ def pipeline(
model = get_default_model(targeted_task, framework, task_options)
logger.warning(f"No model was supplied, defaulted to {model} (https://huggingface.co/{model})")
# Retrieve use_auth_token and add it to model_kwargs to be used in .from_pretrained
model_kwargs["use_auth_token"] = model_kwargs.get("use_auth_token", use_auth_token)
# Config is the primordial information item.
# Instantiate config if needed
if isinstance(config, str):
......@@ -419,9 +422,6 @@ def pipeline(
model_name = model if isinstance(model, str) else None
# Retrieve use_auth_token and add it to model_kwargs to be used in .from_pretrained
model_kwargs["use_auth_token"] = model_kwargs.get("use_auth_token", use_auth_token)
# Infer the framework from the model
# Forced if framework already defined, inferred if it's None
# Will load the correct model if possible
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment