Fix HuggingFace path for text completion quickstart

This commit is contained in:
Javid Lakha 2025-02-28 16:44:02 -05:00 committed by GitHub
parent 66edeee5a4
commit d8002428b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -129,7 +129,7 @@ You can directly employ [Huggingface's Transformers](https://github.com/huggingf
import torch import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
model_name = "deepseek-ai/deepseek-ai/deepseek-moe-16b-base" model_name = "deepseek-ai/deepseek-moe-16b-base"
tokenizer = AutoTokenizer.from_pretrained(model_name) tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto") model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
model.generation_config = GenerationConfig.from_pretrained(model_name) model.generation_config = GenerationConfig.from_pretrained(model_name)