An exclusively Italian speaking, instruction finetuned, Large Language model. 🇮🇹
The Loquace Italian LLM models are created as a proof-of-concept to evaluate on how language tuning can be achieved using QLoRa by instruct-tunings foundational LLMs
using dataset of a specific language.
The QLoRa (
https://github.com/artidoro/qlora) method of fine-tuning significantly lower the resources requirements compared to any other methods available,
this allow to easily execute the process on significanly larger dataset while still using consumers GPUs and still achieve high accuracy.
Loquace-20B is the first 20B italian Large Language Model trained using QLoRa on a large dataset of 102k question/answer pairs
exclusively in Italian.
1from transformers import (
2 AutoTokenizer,
3 AutoModelForCausalLM,
4 BitsAndBytesConfig
5)
6
7tokenizer = AutoTokenizer.from_pretrained("cosimoiaia/Loquace-20B", padding_side="right", use_fast=True)
8model = AutoModelForCausalLM.from_pretrained(
9 "cosimoiaia/Loquace-20B",
10 load_in_8bit=True,
11 device_map="auto",
12 quantization_config=BitsAndBytesConfig(
13 load_in_4bit=True,
14 llm_int8_has_fp16_weight=False
15 )
16)
Loquace-20B was trained on a conversational dataset comprising 102k question/answer pairs in Italian language.
The training data was constructed by putting together translations from the original alpaca Dataset and other sources like the OpenAssistant dataset.
The model was trained for only 3000 iterations and took 68 hours on 4 RTX 3090, kindly provided by Genesis Cloud. (
https://gnsiscld.co/26qhlf)