Skip to content

Commit f351a2a

Browse files
committed
fix
1 parent 30442f4 commit f351a2a

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

optimum/executorch/modeling.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,6 @@ def from_pretrained(
406406
config: Optional[PretrainedConfig] = None,
407407
**kwargs,
408408
):
409-
use_auth_token = kwargs.pop("use_auth_token", None)
410-
if use_auth_token is not None:
411-
logger.warning(
412-
"The `use_auth_token` argument is deprecated and will be removed soon. Please use the `token` argument instead."
413-
)
414-
if token is not None:
415-
raise ValueError("You cannot use both `use_auth_token` and `token` arguments at the same time.")
416-
token = use_auth_token
417-
418409
if isinstance(model_id, Path):
419410
model_id = model_id.as_posix()
420411

@@ -447,15 +438,15 @@ def from_pretrained(
447438
_export = True
448439
else:
449440
logger.warning(
450-
f"No ExecuTorch files were found for {model_id}, setting `export=True` to convert the model to the OpenVINO IR. "
441+
f"No ExecuTorch files were found for {model_id}, setting `export=True` to convert the model to the ExecuTorch IR. "
451442
# "Don't forget to save the resulting model with `.save_pretrained()`"
452443
)
453444
except Exception as exception:
454445
logger.warning(
455446
f"Could not infer whether the model was already converted or not to the ExecuTorch IR, keeping `export={export}`.\n{exception}"
456447
)
457448

458-
from_pretrained_method = cls._export if export else cls._from_pretrained
449+
from_pretrained_method = cls._export if _export else cls._from_pretrained
459450

460451
return from_pretrained_method(
461452
model_id=model_id,

0 commit comments

Comments
 (0)