MehdiHosseiniMoghadam
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -32,52 +32,6 @@ Fine-Tuned Llama 3.2 Persian Large Language Model LLM / Persian Llama 3.2
|
|
32 |
|
33 |
|
34 |
|
35 |
-
### Usage:
|
36 |
-
|
37 |
-
All models are hosted in HuggingFace, and here is the code for inference:
|
38 |
-
|
39 |
-
```py
|
40 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
|
41 |
-
import torch
|
42 |
-
|
43 |
-
model_name_or_id = "MehdiHosseiniMoghadam/AVA-Llama-3-V2"
|
44 |
-
model = AutoModelForCausalLM.from_pretrained(model_name_or_id, torch_dtype=torch.float16, device_map="auto", low_cpu_mem_usage=True, load_in_8bit=True)
|
45 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name_or_id)
|
46 |
-
|
47 |
-
prompt = ''
|
48 |
-
|
49 |
-
prompt = f"### Human:{prompt}\n### Assistant:"
|
50 |
-
|
51 |
-
|
52 |
-
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
53 |
-
|
54 |
-
generation_config = GenerationConfig(
|
55 |
-
do_sample=True,
|
56 |
-
top_k=1,
|
57 |
-
temperature=0.99,
|
58 |
-
max_new_tokens=90,
|
59 |
-
pad_token_id=tokenizer.eos_token_id
|
60 |
-
)
|
61 |
-
|
62 |
-
|
63 |
-
outputs = model.generate(**inputs, generation_config=generation_config)
|
64 |
-
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
65 |
-
|
66 |
-
|
67 |
-
```
|
68 |
-
|
69 |
-
You can also use colab link in the jupyter file
|
70 |
-
|
71 |
-
-------------------------------------------------
|
72 |
-
|
73 |
-
## QA Comparision to other models:
|
74 |
-
|
75 |
-
<img src="AVA2.jpg" height="600" width="940" >
|
76 |
-
|
77 |
-
|
78 |
-
[AVA-Llama-3.2](https://huggingface.co/MehdiHosseiniMoghadam/AVA-Llama-3-V2) vs [AVA-V4](https://huggingface.co/MehdiHosseiniMoghadam/AVA-Mistral-7B-V4) vs [AVA-V2](https://huggingface.co/MehdiHosseiniMoghadam/AVA-Mistral-7B-V2) vs [Maral](https://huggingface.co/MaralGPT/Maral-7B-alpha-1) vs [Llama](https://huggingface.co/hdeldar/llama-2-7b-persian-text-1k)
|
79 |
-
|
80 |
-
|
81 |
### Q1:
|
82 |
```
|
83 |
طبق متن زیر ایلان ماسک در کجا به دنیا امده است؟
|
|
|
32 |
|
33 |
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
### Q1:
|
36 |
```
|
37 |
طبق متن زیر ایلان ماسک در کجا به دنیا امده است؟
|