Update app.py
Browse files
app.py
CHANGED
@@ -28,8 +28,10 @@ model, tokenizer = FastLanguageModel.from_pretrained(
|
|
28 |
max_seq_length=max_seq_length,
|
29 |
dtype=dtype,
|
30 |
load_in_4bit=load_in_4bit,
|
31 |
-
token=hf_token
|
|
|
32 |
)
|
|
|
33 |
print("Model and tokenizer loaded successfully.")
|
34 |
|
35 |
print("Configuring PEFT model...")
|
@@ -119,7 +121,7 @@ trainer = SFTTrainer(
|
|
119 |
bf16=is_bfloat16_supported(),
|
120 |
warmup_steps=5,
|
121 |
logging_steps=10,
|
122 |
-
max_steps=
|
123 |
optim="adamw_8bit",
|
124 |
weight_decay=0.01,
|
125 |
lr_scheduler_type="linear",
|
|
|
28 |
max_seq_length=max_seq_length,
|
29 |
dtype=dtype,
|
30 |
load_in_4bit=load_in_4bit,
|
31 |
+
token=hf_token,
|
32 |
+
load_in_8bit_fp32_cpu_offload=True, # Enable CPU offloading
|
33 |
)
|
34 |
+
|
35 |
print("Model and tokenizer loaded successfully.")
|
36 |
|
37 |
print("Configuring PEFT model...")
|
|
|
121 |
bf16=is_bfloat16_supported(),
|
122 |
warmup_steps=5,
|
123 |
logging_steps=10,
|
124 |
+
max_steps=50,
|
125 |
optim="adamw_8bit",
|
126 |
weight_decay=0.01,
|
127 |
lr_scheduler_type="linear",
|