Downloads · 30 days
24
1% of all-time downloads
cosimoiaia/Loquace-7B-Mistral
Loquace-7B-Mistral is a text generation model from cosimoiaia. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Model Card for Loquace-7B-Mistral (Versione in Italiano tradotta da Loquace)
Downloads · 30 days
24
1% of all-time downloads
All-time downloads
3.7K
Public
Parameters
7.2B
14.5 GB on disk
Likes
17
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README
Model Card for Loquace-7B-Mistral (Versione in Italiano tradotta da Loquace)
Loquace is an Italian speaking, instruction finetuned, Large Language model. 🇮🇹
Loquace-7B-Mistral's peculiar features:
The Loquace Italian LLM models are created with the goal of democratizing AI and LLM in the Italian Landscape.
<b>No more need for expensive GPU, large funding, Big Corporation or Ivory Tower Institution, just download the code and train on your dataset on your own PC (or a cheap and reliable cloud provider like Genesis Cloud )</b>
The related code can be found at: https://github.com/cosimoiaia/Loquace
8bit quantized Version of Loquace can be found here
Here is an incomplate list of clients and libraries that are known to support GGUF (thanks to TheBloke for this list and his awesome work) ):
The Loquace family started in the beginning of 2023 to prove it was possible to fine-tune a Large Language model in a different language, you can find the other members of the family here:
These model, although not producing good results, are proof that cheap finetuning is actually possible in a short amount of time, with a relaively raw dataset and extremely low resources.
from transformers import MistralForCausalLM, AutoTokenizer
def generate_prompt(instruction):
prompt = f"""### Instruction: {instruction}
### Response:
"""
return prompt
model_name = "cosimoiaia/Loquace-7B-Mistral"
model = MistralForCausalLM.from_pretrained(
model_name,
device_map="auto",
torch_dtype=torch.bfloat16
)
model.config.use_cache = True
tokenizer = AutoTokenizer.from_pretrained(model_name, add_eos_token=False)
prompt = generate_prompt("Chi era Dante Alighieri?")
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, do_sample = True, num_beams = 2, top_k=50, top_p= 0.95, max_new_tokens=2046, early_stopping = True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True).split("Response:")[1].strip())
> Pretendi di essere Dante Alighieri e raccontami la tua vita.
Sono Dante Alighieri, un poeta e scrittore italiano del XIV secolo. Nacqui a Firenze nel 1265 e ho trascorso gran parte della mia vita viaggiando in Europa e scrivendo poesie. Ho anche scritto la Divina Commedia, una delle opere letterarie più famose di tutti i tempi.
> Quanto fa 7 x 14 - 98 ?
7 x 14 = 98, quindi la risposta è 0.
> La radice quadrata di 144 ?
La radice quadrata di 144 è 12.
> Inventa una ricetta pugliese con la polenta.
La ricetta è chiamata "Polenta al burro di arachidi e formaggio". Per prepararla, inizia bollendo la polenta secondo le istruzioni sulla confezione. Mentre la polenta si cucina, mescola insieme 1/2 tazza di burro di arachidi, 1/4 di tazza di formaggio grattugiato e 1/4 di tazza di parmigiano grattugiato. Una volta che la polenta è cotta, versala su una teglia da forno e distribuire il composto di burro di arachidi e formaggio sopra la polenta. Metti in forno a 350 gradi per 15 minuti o fino a quando la parte superiore è dorata. Servi caldo con un'insalata di pomodoro e basilico fresco.
Cosimo Iaia [email protected]