修改 bug 和模型规格(1B),减少资源用量

This commit is contained in:
Tian jianyong 2025-03-28 17:07:38 +08:00
parent 8ad2bfd1d2
commit 36e226222d

View File

@ -1,4 +1,4 @@
from unsloth import FastLanguageModel
from unsloth import FastLanguageModel, FastModel
import torch
from trl import SFTTrainer, SFTConfig
from datasets import load_dataset
@ -29,7 +29,7 @@ fourbit_models = [
] # More models at https://huggingface.co/unsloth
model, tokenizer = FastModel.from_pretrained(
model_name = "unsloth/gemma-3-4B-it",
model_name = "unsloth/gemma-3-1B-it",
max_seq_length = 2048, # Choose any for long context!
load_in_4bit = True, # 4 bit quantization to reduce memory
load_in_8bit = False, # [NEW!] A bit more accurate, uses 2x memory