riccorl's picture
Update README.md
4d2c580 verified
|
raw
history blame
930 Bytes
---
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