Skip to content

Commit e4930d6

Browse files
cyyeverSunMarc
andauthored
🚨 [V5] Remove deprecated resume_download (#41122)
Remove deprecated `resume_download` Signed-off-by: Yuanyuan Chen <cyyever@outlook.com> Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
1 parent 7adb43e commit e4930d6

22 files changed

+0
-117
lines changed

src/transformers/configuration_utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,6 @@ def from_pretrained(
549549
force_download (`bool`, *optional*, defaults to `False`):
550550
Whether or not to force to (re-)download the configuration files and override the cached versions if
551551
they exist.
552-
resume_download:
553-
Deprecated and ignored. All downloads are now resumed by default when possible.
554-
Will be removed in v5 of Transformers.
555552
proxies (`dict[str, str]`, *optional*):
556553
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
557554
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
@@ -674,7 +671,6 @@ def _get_config_dict(
674671
) -> tuple[dict[str, Any], dict[str, Any]]:
675672
cache_dir = kwargs.pop("cache_dir", None)
676673
force_download = kwargs.pop("force_download", False)
677-
resume_download = kwargs.pop("resume_download", None)
678674
proxies = kwargs.pop("proxies", None)
679675
token = kwargs.pop("token", None)
680676
local_files_only = kwargs.pop("local_files_only", False)
@@ -718,7 +714,6 @@ def _get_config_dict(
718714
cache_dir=cache_dir,
719715
force_download=force_download,
720716
proxies=proxies,
721-
resume_download=resume_download,
722717
local_files_only=local_files_only,
723718
token=token,
724719
user_agent=user_agent,

src/transformers/dynamic_module_utils.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ def get_cached_module_file(
318318
module_file: str,
319319
cache_dir: Optional[Union[str, os.PathLike]] = None,
320320
force_download: bool = False,
321-
resume_download: Optional[bool] = None,
322321
proxies: Optional[dict[str, str]] = None,
323322
token: Optional[Union[bool, str]] = None,
324323
revision: Optional[str] = None,
@@ -348,9 +347,6 @@ def get_cached_module_file(
348347
force_download (`bool`, *optional*, defaults to `False`):
349348
Whether or not to force to (re-)download the configuration files and override the cached versions if they
350349
exist.
351-
resume_download:
352-
Deprecated and ignored. All downloads are now resumed by default when possible.
353-
Will be removed in v5 of Transformers.
354350
proxies (`dict[str, str]`, *optional*):
355351
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
356352
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
@@ -409,7 +405,6 @@ def get_cached_module_file(
409405
cache_dir=cache_dir,
410406
force_download=force_download,
411407
proxies=proxies,
412-
resume_download=resume_download,
413408
local_files_only=local_files_only,
414409
token=token,
415410
revision=revision,
@@ -469,7 +464,6 @@ def get_cached_module_file(
469464
f"{Path(module_file).parent / module_needed}.py",
470465
cache_dir=cache_dir,
471466
force_download=force_download,
472-
resume_download=resume_download,
473467
proxies=proxies,
474468
token=token,
475469
revision=revision,
@@ -496,7 +490,6 @@ def get_class_from_dynamic_module(
496490
pretrained_model_name_or_path: Union[str, os.PathLike],
497491
cache_dir: Optional[Union[str, os.PathLike]] = None,
498492
force_download: bool = False,
499-
resume_download: Optional[bool] = None,
500493
proxies: Optional[dict[str, str]] = None,
501494
token: Optional[Union[bool, str]] = None,
502495
revision: Optional[str] = None,
@@ -539,9 +532,6 @@ def get_class_from_dynamic_module(
539532
force_download (`bool`, *optional*, defaults to `False`):
540533
Whether or not to force to (re-)download the configuration files and override the cached versions if they
541534
exist.
542-
resume_download:
543-
Deprecated and ignored. All downloads are now resumed by default when possible.
544-
Will be removed in v5 of Transformers.
545535
proxies (`dict[str, str]`, *optional*):
546536
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
547537
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
@@ -606,7 +596,6 @@ def get_class_from_dynamic_module(
606596
module_file + ".py",
607597
cache_dir=cache_dir,
608598
force_download=force_download,
609-
resume_download=resume_download,
610599
proxies=proxies,
611600
token=token,
612601
revision=code_revision,

src/transformers/feature_extraction_utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,6 @@ def from_pretrained(
275275
force_download (`bool`, *optional*, defaults to `False`):
276276
Whether or not to force to (re-)download the feature extractor files and override the cached versions
277277
if they exist.
278-
resume_download:
279-
Deprecated and ignored. All downloads are now resumed by default when possible.
280-
Will be removed in v5 of Transformers.
281278
proxies (`dict[str, str]`, *optional*):
282279
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
283280
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
@@ -433,7 +430,6 @@ def get_feature_extractor_dict(
433430
"""
434431
cache_dir = kwargs.pop("cache_dir", None)
435432
force_download = kwargs.pop("force_download", False)
436-
resume_download = kwargs.pop("resume_download", None)
437433
proxies = kwargs.pop("proxies", None)
438434
subfolder = kwargs.pop("subfolder", None)
439435
token = kwargs.pop("token", None)
@@ -487,7 +483,6 @@ def get_feature_extractor_dict(
487483
cache_dir=cache_dir,
488484
force_download=force_download,
489485
proxies=proxies,
490-
resume_download=resume_download,
491486
local_files_only=local_files_only,
492487
subfolder=subfolder,
493488
token=token,

src/transformers/generation/configuration_utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,6 @@ def from_pretrained(
796796
force_download (`bool`, *optional*, defaults to `False`):
797797
Whether or not to force to (re-)download the configuration files and override the cached versions if
798798
they exist.
799-
resume_download:
800-
Deprecated and ignored. All downloads are now resumed by default when possible.
801-
Will be removed in v5 of Transformers.
802799
proxies (`dict[str, str]`, *optional*):
803800
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
804801
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
@@ -862,7 +859,6 @@ def from_pretrained(
862859
```"""
863860
config_file_name = config_file_name if config_file_name is not None else GENERATION_CONFIG_NAME
864861

865-
resume_download = kwargs.pop("resume_download", None)
866862
proxies = kwargs.pop("proxies", None)
867863
use_auth_token = kwargs.pop("use_auth_token", None)
868864
subfolder = kwargs.pop("subfolder", "")
@@ -906,7 +902,6 @@ def from_pretrained(
906902
cache_dir=cache_dir,
907903
force_download=force_download,
908904
proxies=proxies,
909-
resume_download=resume_download,
910905
local_files_only=local_files_only,
911906
token=token,
912907
user_agent=user_agent,

src/transformers/image_processing_base.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@ def from_pretrained(
119119
force_download (`bool`, *optional*, defaults to `False`):
120120
Whether or not to force to (re-)download the image processor files and override the cached versions if
121121
they exist.
122-
resume_download:
123-
Deprecated and ignored. All downloads are now resumed by default when possible.
124-
Will be removed in v5 of Transformers.
125122
proxies (`dict[str, str]`, *optional*):
126123
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
127124
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
@@ -285,7 +282,6 @@ def get_image_processor_dict(
285282
"""
286283
cache_dir = kwargs.pop("cache_dir", None)
287284
force_download = kwargs.pop("force_download", False)
288-
resume_download = kwargs.pop("resume_download", None)
289285
proxies = kwargs.pop("proxies", None)
290286
token = kwargs.pop("token", None)
291287
use_auth_token = kwargs.pop("use_auth_token", None)
@@ -340,7 +336,6 @@ def get_image_processor_dict(
340336
cache_dir=cache_dir,
341337
force_download=force_download,
342338
proxies=proxies,
343-
resume_download=resume_download,
344339
local_files_only=local_files_only,
345340
token=token,
346341
user_agent=user_agent,

src/transformers/modeling_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4503,7 +4503,6 @@ def from_pretrained(
45034503
tp_plan = "auto"
45044504

45054505
# Not used anymore -- remove them from the kwargs
4506-
_ = kwargs.pop("resume_download", None)
45074506
_ = kwargs.pop("mirror", None)
45084507
_ = kwargs.pop("_fast_init", None)
45094508
_ = kwargs.pop("low_cpu_mem_usage", None)

src/transformers/models/auto/auto_factory.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@
126126
force_download (`bool`, *optional*, defaults to `False`):
127127
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
128128
cached versions if they exist.
129-
resume_download:
130-
Deprecated and ignored. All downloads are now resumed by default when possible.
131-
Will be removed in v5 of Transformers.
132129
proxies (`dict[str, str]`, *optional*):
133130
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
134131
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
@@ -260,7 +257,6 @@ def from_pretrained(cls, pretrained_model_name_or_path: Union[str, os.PathLike[s
260257
"force_download",
261258
"local_files_only",
262259
"proxies",
263-
"resume_download",
264260
"revision",
265261
"subfolder",
266262
"use_auth_token",

src/transformers/models/auto/configuration_auto.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,9 +1255,6 @@ def from_pretrained(cls, pretrained_model_name_or_path: Union[str, os.PathLike[s
12551255
force_download (`bool`, *optional*, defaults to `False`):
12561256
Whether or not to force the (re-)download the model weights and configuration files and override the
12571257
cached versions if they exist.
1258-
resume_download:
1259-
Deprecated and ignored. All downloads are now resumed by default when possible.
1260-
Will be removed in v5 of Transformers.
12611258
proxies (`dict[str, str]`, *optional*):
12621259
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
12631260
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.

src/transformers/models/auto/feature_extraction_auto.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ def get_feature_extractor_config(
107107
pretrained_model_name_or_path: Union[str, os.PathLike],
108108
cache_dir: Optional[Union[str, os.PathLike]] = None,
109109
force_download: bool = False,
110-
resume_download: Optional[bool] = None,
111110
proxies: Optional[dict[str, str]] = None,
112111
token: Optional[Union[bool, str]] = None,
113112
revision: Optional[str] = None,
@@ -132,9 +131,6 @@ def get_feature_extractor_config(
132131
force_download (`bool`, *optional*, defaults to `False`):
133132
Whether or not to force to (re-)download the configuration files and override the cached versions if they
134133
exist.
135-
resume_download:
136-
Deprecated and ignored. All downloads are now resumed by default when possible.
137-
Will be removed in v5 of Transformers.
138134
proxies (`dict[str, str]`, *optional*):
139135
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
140136
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
@@ -187,7 +183,6 @@ def get_feature_extractor_config(
187183
FEATURE_EXTRACTOR_NAME,
188184
cache_dir=cache_dir,
189185
force_download=force_download,
190-
resume_download=resume_download,
191186
proxies=proxies,
192187
token=token,
193188
revision=revision,
@@ -249,9 +244,6 @@ def from_pretrained(cls, pretrained_model_name_or_path, **kwargs):
249244
force_download (`bool`, *optional*, defaults to `False`):
250245
Whether or not to force to (re-)download the feature extractor files and override the cached versions
251246
if they exist.
252-
resume_download:
253-
Deprecated and ignored. All downloads are now resumed by default when possible.
254-
Will be removed in v5 of Transformers.
255247
proxies (`dict[str, str]`, *optional*):
256248
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
257249
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.

src/transformers/models/auto/image_processing_auto.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ def get_image_processor_config(
244244
pretrained_model_name_or_path: Union[str, os.PathLike],
245245
cache_dir: Optional[Union[str, os.PathLike]] = None,
246246
force_download: bool = False,
247-
resume_download: Optional[bool] = None,
248247
proxies: Optional[dict[str, str]] = None,
249248
token: Optional[Union[bool, str]] = None,
250249
revision: Optional[str] = None,
@@ -269,9 +268,6 @@ def get_image_processor_config(
269268
force_download (`bool`, *optional*, defaults to `False`):
270269
Whether or not to force to (re-)download the configuration files and override the cached versions if they
271270
exist.
272-
resume_download:
273-
Deprecated and ignored. All downloads are now resumed by default when possible.
274-
Will be removed in v5 of Transformers.
275271
proxies (`dict[str, str]`, *optional*):
276272
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
277273
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
@@ -324,7 +320,6 @@ def get_image_processor_config(
324320
IMAGE_PROCESSOR_NAME,
325321
cache_dir=cache_dir,
326322
force_download=force_download,
327-
resume_download=resume_download,
328323
proxies=proxies,
329324
token=token,
330325
revision=revision,
@@ -394,9 +389,6 @@ def from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs):
394389
force_download (`bool`, *optional*, defaults to `False`):
395390
Whether or not to force to (re-)download the image processor files and override the cached versions if
396391
they exist.
397-
resume_download:
398-
Deprecated and ignored. All downloads are now resumed by default when possible.
399-
Will be removed in v5 of Transformers.
400392
proxies (`dict[str, str]`, *optional*):
401393
A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
402394
'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.

0 commit comments

Comments
 (0)