Skip to content

Commit

Permalink
Update transformers.deepspeed references from transformers 4.46.0 rel…
Browse files Browse the repository at this point in the history
…ease (#3196)

* Update dataclasses.py

* Update test_deepspeed.py
  • Loading branch information
loadams authored Oct 24, 2024
1 parent 85f3564 commit ba7ab93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/accelerate/utils/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ def set_deepspeed_weakref(self):
if ds_config.get("train_batch_size", None) == "auto":
del ds_config["train_batch_size"]

if compare_versions("transformers", "<", "4.33"):
if compare_versions("transformers", "<", "4.46"):
from transformers.deepspeed import HfDeepSpeedConfig, unset_hf_deepspeed_config
else:
from transformers.integrations import HfDeepSpeedConfig, unset_hf_deepspeed_config
Expand Down
2 changes: 1 addition & 1 deletion tests/deepspeed/test_deepspeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def test_init_zero3(self):

with mockenv_context(**self.dist_env):
accelerator = Accelerator(deepspeed_plugin=deepspeed_plugin) # noqa: F841
from transformers.deepspeed import is_deepspeed_zero3_enabled
from transformers.integrations import is_deepspeed_zero3_enabled

assert is_deepspeed_zero3_enabled()

Expand Down

0 comments on commit ba7ab93

Please sign in to comment.