You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"The `use_auth_token` argument is deprecated and will be removed soon. "
167
+
"Please use the `token` argument instead."
168
+
)
169
+
iftokenisnotNone:
170
+
raiseValueError("You cannot use both `use_auth_token` and `token` arguments at the same time.")
171
+
172
+
token=use_auth_token
173
+
use_auth_token=None
174
+
164
175
ifis_torch_version("<", "2.1.0"):
165
176
raiseImportError("`torch>=2.0.0` is needed to trace your model")
166
177
167
178
task=cls.export_feature
168
179
model_kwargs= {
169
180
"revision": revision,
170
-
"use_auth_token": use_auth_token,
171
181
"token": token,
172
182
"cache_dir": cache_dir,
173
183
"subfolder": subfolder,
@@ -200,6 +210,17 @@ def _from_pretrained(
200
210
subfolder: str="",
201
211
**kwargs,
202
212
):
213
+
ifuse_auth_tokenisnotNone:
214
+
logger.warning(
215
+
"The `use_auth_token` argument is deprecated and will be removed soon. "
216
+
"Please use the `token` argument instead."
217
+
)
218
+
iftokenisnotNone:
219
+
raiseValueError("You cannot use both `use_auth_token` and `token` arguments at the same time.")
220
+
221
+
token=use_auth_token
222
+
use_auth_token=None
223
+
203
224
ifnotgetattr(config, "torchscript", False):
204
225
raiseValueError(
205
226
"`config.torchscript` should be set to `True`, if your model is not a TorchScript model and needs to be traced please set `export=True` when loading it with `.from_pretrained()`"
0 commit comments