Dante Alighieri
Collection
a funny little experiment to make LLMs talk like the ancient Italian poet • 4 items • Updated • 1
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("FinancialSupport/saiga-7b")
model = AutoModelForCausalLM.from_pretrained("FinancialSupport/saiga-7b")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))il saiga è uno strano incrocio di antilopi che vive nelle steppe siberiane.
Il nome deriva dal fatto che è un parente di fauno/camoscio e un lontano cugino di cerbero (altri modelli open source ita).
E' un progetto portato avanti nei weekend con pochi soldi/tempo a disposizione

Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 64.51 |
| AI2 Reasoning Challenge (25-Shot) | 63.14 |
| HellaSwag (10-Shot) | 83.14 |
| MMLU (5-Shot) | 61.66 |
| TruthfulQA (0-shot) | 54.99 |
| Winogrande (5-shot) | 79.01 |
| GSM8k (5-shot) | 45.11 |
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FinancialSupport/saiga-7b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)