File size: 930 Bytes
6e5acd0 4d2c580 dd7fc58 9ffc70f dd7fc58 6e5acd0 dd7fc58 6e5acd0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
---
license: mit
language:
- it
---
# Modello Italia 9B
HF-compatible version of Modello Italia 9B, developed by iGenius.
```python
import torch
import transformers as tr
tokenizer = tr.AutoTokenizer.from_pretrained("riccorl/Modello-Italia-9B-hf")
model = tr.AutoModelForCausalLM.from_pretrained(
"riccorl/Modello-Italia-9B-hf",
device_map="auto",
torch_dtype=torch.bfloat16
)
MY_SYSTEM_PROMPT_SHORT = (
"Tu sei Modello Italia, un modello di linguaggio naturale addestrato da iGenius."
)
prompt = "Ciao, chi sei?"
messages = [
{"role": "system", "content": MY_SYSTEM_PROMPT_SHORT},
{"role": "user", "content": prompt},
]
tokenized_chat = tokenizer.apply_chat_template(
messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
)
out = model.generate(tokenized_chat.to("cuda"), max_new_tokens=200)
```
License: MIT(?)
License PDF: https://secure.igenius.ai/legal/italia_terms_and_conditions.pdf
|