Mo-alaa commited on
Commit
4327087
·
verified ·
1 Parent(s): 166a787

Create model.py

Browse files
Files changed (1) hide show
  1. model.py +11 -0
model.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import AutoModelForCausalLM, AutoTokenizer
2
+
3
+ @torch.no_grad()
4
+ def create_model():
5
+ tokenizer = AutoTokenizer.from_pretrained('stabilityai/stablelm-zephyr-3b')
6
+ model = AutoModelForCausalLM.from_pretrained(
7
+ 'stabilityai/stablelm-zephyr-3b',
8
+ trust_remote_code=True,
9
+ device_map="auto"
10
+ )
11
+ return model,tokenizer