Downloads · 30 days
0
rstless-research/DanteLLM-7B-Instruct-Italian-v0.1
DanteLLM-7B-Instruct-Italian-v0.1 is a machine learning model from rstless-research. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
0
Access
Public
Updated Mar 14, 2024
Parameters
7.2B
29 GB on disk
Likes
4
Public
Click a slice to open those files.
.safetensors29 GB · 100%
From the Hugging Face model README
DanteLLM is a Large Language Model developed in Sapienza lab. In October 2023 we submitted a paper called DanteLLM: Let's Push Italian LLM Research Forward! 🤌 🇮🇹
That paper got accepted with the scores 5, 4, 4 out of 5
from transformers import AutoTokenizer, AutoModelForCausalLM
device = "cuda" # the device to load the model onto
model_id = "rstless-research/DanteLLM-7B-Instruct-Italian-v0.1"
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", load_in_8bit=True)
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
model.eval()
messages = [
{"role": "user", "content": "Ciao chi sei?"},
{"role": "assistant", "content": "Ciao, sono DanteLLM, un large language model. Come posso aiutarti?"},
{"role": "user", "content": "Quanto dista la Terra dalla Luna?"}
]
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
model_inputs = encodeds.to(device)
model.to(device)
generated_ids = model.generate(input_ids=model_inputs, max_new_tokens=300, do_sample=True, temperature=0.3)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
# La Terra si trova a 384,400 chilometri (238,855 miglia) dalla Luna. La distanza varia leggermente a causa della sua orbita ellittica.
* Equal contribution