File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/transformers/pipelines Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -410,6 +410,9 @@ def pipeline(
410
410
model = get_default_model (targeted_task , framework , task_options )
411
411
logger .warning (f"No model was supplied, defaulted to { model } (https://huggingface.co/{ model } )" )
412
412
413
+ # Retrieve use_auth_token and add it to model_kwargs to be used in .from_pretrained
414
+ model_kwargs ["use_auth_token" ] = model_kwargs .get ("use_auth_token" , use_auth_token )
415
+
413
416
# Config is the primordial information item.
414
417
# Instantiate config if needed
415
418
if isinstance (config , str ):
@@ -419,9 +422,6 @@ def pipeline(
419
422
420
423
model_name = model if isinstance (model , str ) else None
421
424
422
- # Retrieve use_auth_token and add it to model_kwargs to be used in .from_pretrained
423
- model_kwargs ["use_auth_token" ] = model_kwargs .get ("use_auth_token" , use_auth_token )
424
-
425
425
# Infer the framework from the model
426
426
# Forced if framework already defined, inferred if it's None
427
427
# Will load the correct model if possible
You can’t perform that action at this time.
0 commit comments