File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ RUN apt-get update && \
11
11
12
12
WORKDIR /workspace
13
13
14
+ RUN pip3 install --force-reinstall "peft @ git+https://github.com/huggingface/peft.git@main"
14
15
RUN git clone --depth=1 https://github.com/OpenAccess-AI-Collective/axolotl.git
15
16
# If AXOLOTL_EXTRAS is set, append it in brackets
16
17
RUN cd axolotl && \
Original file line number Diff line number Diff line change @@ -147,13 +147,17 @@ def load_model(
147
147
LOG .exception (err )
148
148
raise err
149
149
150
- try :
151
- from peft import prepare_model_for_kbit_training
152
- except ImportError :
153
- # For backward compatibility
154
- from peft import (
155
- prepare_model_for_int8_training as prepare_model_for_kbit_training ,
156
- )
150
+ if not cfg .gptq and (
151
+ (cfg .adapter == "lora" and load_in_8bit )
152
+ or (cfg .adapter == "qlora" and cfg .load_in_4bit )
153
+ ):
154
+ try :
155
+ from peft import prepare_model_for_kbit_training
156
+ except ImportError :
157
+ # For backward compatibility
158
+ from peft import (
159
+ prepare_model_for_int8_training as prepare_model_for_kbit_training ,
160
+ )
157
161
158
162
model_kwargs = {}
159
163
if cfg .model_revision :
You can’t perform that action at this time.
0 commit comments