mirror of
https://github.com/deepseek-ai/DeepSeek-MoE.git
synced 2025-05-18 00:07:33 -04:00
Merge d8002428b9
into 66edeee5a4
This commit is contained in:
commit
a07c78c4c5
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user