Views
No views yet

UltraChat dataset, which contains a diverse range of synthetic dialogues generated by ChatGPT.1# Install transformers from source - only needed for versions <= v4.34
2# pip install git+https://github.com/huggingface/transformers.git
3# pip install accelerate
4from transformers import AutoModelForCausalLM, AutoTokenizer
5
6model_id = "giux78/zefiro-7b-beta-ITA-v0.1"
7model = AutoModelForCausalLM.from_pretrained(model_id)
8model.to('cuda')
9tokenizer = AutoTokenizer.from_pretrained(model_id, padding_side="left")
10
11
12sys_prompt = "Sei un assistente disponibile, rispettoso e onesto. " \
13 "Rispondi sempre nel modo piu' utile possibile, pur essendo sicuro. " \
14 "Le risposte non devono includere contenuti dannosi, non etici, razzisti, sessisti, tossici, pericolosi o illegali. " \
15 "Assicurati che le tue risposte siano socialmente imparziali e positive. " \
16 "Se una domanda non ha senso o non e' coerente con i fatti, spiegane il motivo invece di rispondere in modo non corretto. " \
17 "Se non conosci la risposta a una domanda, non condividere informazioni false."
18
19messages = [{ 'content' : sys_prompt, 'role' : 'assistant'},
20 {'content' : 'Crea una lista su cosa mangiare a pranzo ogni giorno della settimana a pranzo e cena', 'role' : 'user'}]
21
22
23def generate_text(sys_prompt, user_prompt):
24 messages = [{ 'content' : sys_prompt, 'role' : 'assistant'},
25 {'content' : user_prompt, 'role' : 'user'}]
26 prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
27 model_inputs = tokenizer([prompt], return_tensors="pt").to("cuda")
28 generated_ids = model.generate(**model_inputs, max_new_tokens=1024)
29 return tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
30
31
32generate_text(sys_prompt, 'cosa ne pensi della politica italiana?')mistralai/Mistral-7B-v0.1), however it is likely to have included a mix of Web data and technical sources like books and code. See the Falcon 180B model card for an example of this.UltraChat.
For translating the dataset we combined different tools and API we are also evaluating the best approach for translating many more datasets.
We have seen that the translation phase is critical and can introduce incorrect syntax and semantics.@misc{tunstall2023zephyr,
title={Zephyr: Direct Distillation of LM Alignment},
author={Lewis Tunstall and Edward Beeching and Nathan Lambert and Nazneen Rajani and Kashif Rasul and Younes Belkada and Shengyi Huang and Leandro von Werra and Clémentine Fourrier and Nathan Habib and Nathan Sarrazin and Omar Sanseviero and Alexander M. Rush and Thomas Wolf},
year={2023},
eprint={2310.16944},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
@misc{basile2023llamantino,
title={LLaMAntino: LLaMA 2 Models for Effective Text Generation in Italian Language},
author={Pierpaolo Basile and Elio Musacchio and Marco Polignano and Lucia Siciliani and Giuseppe Fiameni and Giovanni Semeraro},
year={2023},
eprint={2312.09993},
archivePrefix={arXiv},
primaryClass={cs.CL}
}