Italian
English
large language model
italian large language model
baize
llama
italian
openllama
open llama
andreabac3 commited on
Commit
f011496
1 Parent(s): fee8ffa

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +127 -0
README.md ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gpl-3.0
3
+ datasets:
4
+ - andreabac3/MedQuaAD-Italian-Fauno-Baize
5
+ - andreabac3/StackOverflow-Italian-Fauno-Baize
6
+ - andreabac3/Quora-Italian-Fauno-Baize
7
+ - teelinsan/camoscio_cleaned
8
+ language:
9
+ - it
10
+ - en
11
+ tags:
12
+ - large language model
13
+ - italian large language model
14
+ - baize
15
+ - 'llama '
16
+ - italian
17
+ ---
18
+ # Fauno - Italian LLM
19
+
20
+ ![image](fauno.drawio.png)
21
+
22
+ Get ready to meet Fauno - the Italian language model crafted by the [RSTLess Research Group](https://rstless-lab.netlify.app/) from the Sapienza University of Rome.
23
+
24
+ The talented research team behind Fauno includes [Andrea Bacciu](https://andreabac3.github.io/), [Dr. Giovanni Trappolini](https://sites.google.com/view/giovannitrappolini), [Andrea Santilli](https://www.santilli.xyz/), and [Professor Fabrizio Silvestri](https://sites.google.com/diag.uniroma1.it/fabriziosilvestri/home).
25
+
26
+ Fauno represents a cutting-edge development in open-source Italian Large Language Modeling. It's trained on extensive Italian synthetic datasets, encompassing a wide range of fields such as medical data 🩺, technical content from Stack Overflow 💻, Quora discussions 💬, and Alpaca data 🦙 translated into Italian.
27
+
28
+ Hence, our model is able to answer to your questions in Italian 🙋, fix your buggy code 🐛 and understand a minimum of medical literature 💊.
29
+
30
+ <br> This version of Fauno is based on OpenLLaMa!
31
+
32
+ ## The 🇮🇹 open-source version of chatGPT!
33
+ Discover the capabilities of Fauno and experience the evolution of Italian language models for yourself.
34
+ ![demo](screenshot_demo.png)
35
+
36
+ ### Why Fauno?
37
+ We started with a model called Baize, named after a legendary creature from Chinese literature. Continuing along this thematic line, we developed our Italian model based on Baize and named it Fauno, inspired by an iconic figure from Roman mythology. This choice underlines the link between the two models, while maintaining a distinctive identity rooted in Italian culture.
38
+
39
+ # Did you know that you can run Fauno on Colab base?
40
+ Follow this link to access a Colab notebook with our 7B version! <a target="_blank" href="https://colab.research.google.com/drive/1AepJVWS-qU910zyq-Zi7wWFQ5tthVzUe">
41
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
42
+ </a>
43
+
44
+ ## 🔎 Model's details
45
+ Fauno is a fine-tuned version of the LoRa weights of [Baize](https://github.com/project-baize/baize-chatbot), that is an improved version of [LLama](https://github.com/facebookresearch/llama).
46
+
47
+ We translated and cleaned the data of Baize, and then we fine-tuned the 7b model using a single RTX A6000 (48GB of VRAM) with 19 hours for one epoch.
48
+
49
+ - 13B: https://huggingface.co/andreabac3/Fauno-Italian-LLM-13B
50
+
51
+ Fauno 30B and 65B are coming soon!
52
+
53
+ ## Model initialization
54
+ ```python
55
+ from transformers import LlamaTokenizer, LlamaForCausalLM, GenerationConfig
56
+ from peft import PeftModel
57
+
58
+ tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf")
59
+ model = LlamaForCausalLM.from_pretrained(
60
+ "decapoda-research/llama-7b-hf",
61
+ load_in_8bit=True,
62
+ device_map="auto",
63
+ )
64
+ model = PeftModel.from_pretrained(model, "andreabac3/Fauno-Italian-LLM-7B")
65
+ model.eval()
66
+ ```
67
+
68
+ ## Inference
69
+ ```python
70
+ def evaluate(question: str) -> str:
71
+ prompt = f"The conversation between human and AI assistant.\n[|Human|] {question}.\n[|AI|] "
72
+ inputs = tokenizer(prompt, return_tensors="pt")
73
+ input_ids = inputs["input_ids"].cuda()
74
+ generation_output = model.generate(
75
+ input_ids=input_ids,
76
+ generation_config=generation_config,
77
+ return_dict_in_generate=True,
78
+ output_scores=True,
79
+ max_new_tokens=256
80
+ )
81
+ output = tokenizer.decode(generation_output.sequences[0]).split("[|AI|]")[1]
82
+ return output
83
+
84
+ your_question: str = "Qual'è il significato della vita?"
85
+ print(evaluate(your_question))
86
+ ```
87
+
88
+ ### Output
89
+ ```
90
+ Il senso della vita è una domanda che molte persone hanno cercato di rispondere per secoli.
91
+ Alla fine, il senso della vita è soggettivo e varia da persona a persona.
92
+ Alcune persone credono che il senso della vita sia trovare la felicità, mentre altre credono che sia raggiungere i propri obiettivi o aiutare gli altri.
93
+ Alla fine, il senso della vita è determinato dall'individuo e dai loro valori e credenze.
94
+ In definitiva, il senso della vita è qualcosa che ognuno deve trovare da solo.
95
+ Non c'è una risposta giusta o sbagliata, poiché ogni persona ha le proprie convinzioni e credenze.
96
+ La ricerca del senso della vita può essere un viaggio lungo e difficile, ma vale la pena perseguire.
97
+ ```
98
+ # 📖 Cite our work
99
+
100
+ To use our translated dataset and model weights in your research, remember to cite our work.
101
+ ```bibtex
102
+ @misc{fauno,
103
+ author = {Andrea Bacciu, Giovanni Trappolini, Andrea Santilli, Fabrizio Silvestri},
104
+ title = {Fauno: The Italian Large Language Model that will leave you senza parole!},
105
+ year = {2023},
106
+ publisher = {GitHub},
107
+ journal = {GitHub repository},
108
+ howpublished = {\url{https://github.com/andreabac3/Fauno-Italian-LLM}},
109
+ }
110
+ ```
111
+
112
+
113
+ ## 🔑 License
114
+ This project is a derivative of Baize, and we adhere to the licensing constraints imposed by both Baize's creators and the authors of LLama.
115
+
116
+ ## ⚠️ Hallucinations
117
+ It is important to remark that current generation models are prone to the problem of hallucinations. So we advise you not to take their answers seriously.
118
+
119
+ ## 👏 Acknowledgement
120
+ - LLama - Meta AI: https://github.com/facebookresearch/llama
121
+ - Baize: https://github.com/project-baize/baize-chatbot
122
+ - Standford Alpaca: https://github.com/tatsu-lab/stanford_alpaca
123
+ - Camoscio: https://github.com/teelinsan/camoscio
124
+
125
+ #### Image Credits
126
+ - llama image: https://next14.com/en/nextnews-7-march-a-new-language-model-for-meta-bing-ai-on-windows-and-the-first-tokenized-real-estate-sales/
127
+ - Fauno logo: https://www.flaticon.com/free-icon/faun_7931635?term=faun&page=1&position=1&origin=tag&related_id=7931635