Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- it
|
4 |
+
- en
|
5 |
+
license: llama3
|
6 |
+
library_name: transformers
|
7 |
+
base_model: DeepMount00/Llama-3-8b-Ita
|
8 |
+
datasets:
|
9 |
+
- DeepMount00/llm_ita_ultra
|
10 |
+
---
|
11 |
+
# QuantFactory/Llama-3-8b-Ita-GGUF
|
12 |
+
This is quantized version of [DeepMount00/Llama-3-8b-Ita](https://huggingface.co/DeepMount00/Llama-3-8b-Ita) created using llama.cpp
|
13 |
+
|
14 |
+
## Model Description
|
15 |
+
- **Base Model:** [Meta-Llama-3-8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B)
|
16 |
+
- **Specialization:** Italian Language
|
17 |
+
|
18 |
+
## Evaluation
|
19 |
+
|
20 |
+
For a detailed comparison of model performance, check out the [Leaderboard for Italian Language Models](https://huggingface.co/spaces/FinancialSupport/open_ita_llm_leaderboard).
|
21 |
+
|
22 |
+
Here's a breakdown of the performance metrics:
|
23 |
+
|
24 |
+
| Metric | hellaswag_it acc_norm | arc_it acc_norm | m_mmlu_it 5-shot acc | Average |
|
25 |
+
|:----------------------------|:----------------------|:----------------|:---------------------|:--------|
|
26 |
+
| **Accuracy Normalized** | 0.6518 | 0.5441 | 0.5729 | 0.5896 |
|
27 |
+
|
28 |
+
---
|
29 |
+
|
30 |
+
## How to Use
|
31 |
+
|
32 |
+
```python
|
33 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
34 |
+
import torch
|
35 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
36 |
+
|
37 |
+
MODEL_NAME = "DeepMount00/Llama-3-8b-Ita"
|
38 |
+
|
39 |
+
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME, torch_dtype=torch.bfloat16).eval()
|
40 |
+
model.to(device)
|
41 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
|
42 |
+
|
43 |
+
def generate_answer(prompt):
|
44 |
+
messages = [
|
45 |
+
{"role": "user", "content": prompt},
|
46 |
+
]
|
47 |
+
model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(device)
|
48 |
+
generated_ids = model.generate(model_inputs, max_new_tokens=200, do_sample=True,
|
49 |
+
temperature=0.001)
|
50 |
+
decoded = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
|
51 |
+
return decoded[0]
|
52 |
+
|
53 |
+
prompt = "Come si apre un file json in python?"
|
54 |
+
answer = generate_answer(prompt)
|
55 |
+
print(answer)
|
56 |
+
```
|
57 |
+
---
|
58 |
+
## Developer
|
59 |
+
[Michele Montebovi]
|