Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Huggingface SFTTrainer

from packaging import version
import transformers
from transformers import AutoModelForCausalLM, AutoTokenizer

assert version.parse(transformers.__version__) >= version.parse('4.51')
model_name ='deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype='auto',
    device_map='auto',)
Loading...
Loading...
Loading...
Loading...
Loading...