Skip to content

Commit 8c8dd48

Browse files
authored
updated composer and streaming versions (#1857)
1 parent 316a63b commit 8c8dd48

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

llmfoundry/callbacks/hf_checkpointer.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,17 +673,33 @@ def tensor_hook(
673673
# initialization cost.
674674
with init_empty_weights():
675675
if self.using_peft:
676+
import peft
676677
from peft import PeftModel
677678
assert isinstance(original_model, PeftModel)
678679
active_adapter = original_model.active_adapter # type: ignore
679680
base_model: PreTrainedModel = original_model.get_base_model( # type: ignore
680681
)
681682
new_base_model_instance = type(base_model)(new_config)
682683

684+
# TODO: Deprecate this when we no longer support peft 0.16.0 from upstream
685+
if peft.__version__ == '0.16.0':
686+
# due to https://github.com/huggingface/peft/issues/2634, we need to change
687+
# the peft type to an enum. Should be fixed in 0.17.0 by
688+
# https://github.com/huggingface/peft/pull/2635
689+
peft_config = copy.copy(
690+
original_model.
691+
peft_config[active_adapter], # type: ignore
692+
)
693+
peft_config.peft_type = peft.PeftType( # type: ignore
694+
peft_config.peft_type, # type: ignore
695+
)
696+
else:
697+
peft_config = original_model.peft_config[ # type: ignore
698+
active_adapter] # type: ignore
699+
683700
new_model_instance = type(original_model)(
684701
new_base_model_instance, # type: ignore
685-
original_model.
686-
peft_config[active_adapter], # type: ignore
702+
peft_config, # type: ignore
687703
)
688704
del new_base_model_instance
689705
else:

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
]
5252

5353
install_requires = [
54-
'mosaicml[libcloud,wandb,oci,gcs,mlflow]>=0.31.0,<0.33',
54+
'mosaicml[libcloud,wandb,oci,gcs,mlflow]>=0.32.0,<0.33',
5555
'mlflow>=2.14.1,<3.2',
5656
'accelerate>=0.25,<1.9', # for HF inference `device_map`
5757
'transformers>=v4.51.0,<4.52',
@@ -91,15 +91,15 @@
9191
]
9292

9393
extra_deps['databricks'] = [
94-
'mosaicml[databricks]>=0.31.0,<0.32',
94+
'mosaicml[databricks]>=0.32.0,<0.33',
9595
'numpy<2',
9696
'databricks-sql-connector>=3,<4',
9797
'databricks-connect==14.1.0',
9898
'lz4>=4,<5',
9999
]
100100

101101
extra_deps['tensorboard'] = [
102-
'mosaicml[tensorboard]>=0.31.0,<0.32',
102+
'mosaicml[tensorboard]>=0.32.0,<0.33',
103103
]
104104

105105
# Flash 2 group kept for backwards compatibility
@@ -110,7 +110,7 @@
110110
extra_deps['gpu'] = copy.deepcopy(extra_deps['gpu-flash2'])
111111

112112
extra_deps['peft'] = [
113-
'mosaicml[peft]>=0.31.0,<0.32',
113+
'mosaicml[peft]>=0.32.0,<0.33',
114114
]
115115

116116
extra_deps['openai'] = [

0 commit comments

Comments
 (0)