aidal commited on
Commit
f20c925
1 Parent(s): 6e8f421

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +15 -1
README.md CHANGED
@@ -2,4 +2,18 @@
2
  language:
3
  - en
4
  - fa
5
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  language:
3
  - en
4
  - fa
5
+ ---
6
+
7
+ **How to use:**
8
+ ```python
9
+ from transformers import AutoTokenizer, AutoModelForCausalLM
10
+
11
+ tokenizer = AutoTokenizer.from_pretrained("aidal/Persian_Mistral_7B")
12
+ model = AutoModelForCausalLM.from_pretrained("aidal/Persian_Mistral_7B")
13
+
14
+ input_text = "پایتخت ایران کجاست؟"
15
+ input_ids = tokenizer(input_text, return_tensors="pt")
16
+
17
+ outputs = model.generate(**input_ids)
18
+ print(tokenizer.decode(outputs[0]))
19
+ ```