Spaces:
Runtime error
Runtime error
Update grpo_train.py
Browse files- grpo_train.py +3 -0
grpo_train.py
CHANGED
|
@@ -631,10 +631,13 @@ else:
|
|
| 631 |
USE_4BIT = _vram < 40 * 1024**3
|
| 632 |
USE_BF16 = _cc >= (8, 0) and not USE_4BIT
|
| 633 |
|
|
|
|
|
|
|
| 634 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 635 |
model_name="unsloth/Llama-3.2-3B-Instruct",
|
| 636 |
load_in_4bit=False,
|
| 637 |
max_seq_length=2048,
|
|
|
|
| 638 |
)
|
| 639 |
|
| 640 |
model = FastLanguageModel.get_peft_model(
|
|
|
|
| 631 |
USE_4BIT = _vram < 40 * 1024**3
|
| 632 |
USE_BF16 = _cc >= (8, 0) and not USE_4BIT
|
| 633 |
|
| 634 |
+
TRAIN_DTYPE = torch.bfloat16 if USE_BF16 else torch.float16
|
| 635 |
+
|
| 636 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 637 |
model_name="unsloth/Llama-3.2-3B-Instruct",
|
| 638 |
load_in_4bit=False,
|
| 639 |
max_seq_length=2048,
|
| 640 |
+
dtype=TRAIN_DTYPE,
|
| 641 |
)
|
| 642 |
|
| 643 |
model = FastLanguageModel.get_peft_model(
|