efederici commited on
Commit
51f7cfc
·
verified ·
1 Parent(s): 52f0b6f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +110 -3
README.md CHANGED
@@ -1,3 +1,110 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - it
4
+ license: cc-by-nc-4.0
5
+ tags:
6
+ - sft
7
+ - it
8
+ - mistral
9
+ - chatml
10
+ - axolotl
11
+ prompt_template: <|im_start|>system {system_message}<|im_end|> <|im_start|>user {prompt}<|im_end|>
12
+ <|im_start|>assistant
13
+ model-index:
14
+ - name: maestrale-chat-v0.4-beta
15
+ results: []
16
+ ---
17
+ <div style="width: auto; margin-left: auto; margin-right: auto">
18
+ <img src="https://i.imgur.com/CQc6d7W.jpeg" alt="Mii-LLM" style="width: 100%; min-width: 400px; display: block; margin: auto;">
19
+ </div>
20
+ <div style="display: flex; justify-content: space-between; width: 100%;">
21
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
22
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://buy.stripe.com/8wM00Sf3vb3H3pmfYY">Want to contribute? Please donate! This will let us work on better datasets and models!</a></p>
23
+ </div>
24
+ </div>
25
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
26
+ <!-- header end -->
27
+
28
+ # Maestrale chat beta ༄
29
+
30
+ By @efederici and @mferraretto
31
+
32
+ ## Model description
33
+
34
+ - **Language Model**: Mistral-7b for the Italian language, continued pre-training for Italian on a curated large-scale high-quality corpus, merged with [occiglot](https://huggingface.co/occiglot/occiglot-7b-eu5).
35
+ - **Fine-Tuning**: SFT performed on 1.7M convs/instructions for 2 epochs.
36
+ - **DPO**: Aligned with DPO on multiple datasets.
37
+
38
+ **v0.4**
39
+ - Agent
40
+ - Improved truthfullness
41
+ - Improved Math & Reasoning capabilities
42
+ - Mermaid mindmaps
43
+ - More latin translations, poems, ...
44
+
45
+ This model uses ChatML prompt format:
46
+ ```
47
+ <|im_start|>system
48
+ Sei un assistente utile.<|im_end|>
49
+ <|im_start|>user
50
+ {prompt}<|im_end|>
51
+ <|im_start|>assistant
52
+ ```
53
+
54
+ ## Scores
55
+
56
+ | Tasks |Version|Filter|n-shot| Metric |Value | |Stderr|
57
+ |------------|------:|------|-----:|--------|-----:|---|-----:|
58
+ |hellaswag_it| 1|none | 0|acc |0.5270|± |0.0052|
59
+ | | |none | 0|acc_norm|0.7037|± |0.0048|
60
+ |arc_it | 1|none | 0|acc |0.1771|± |0.0112|
61
+ | | |none | 0|acc_norm|0.5218|± |0.0146|
62
+
63
+ ## Usage:
64
+
65
+ ```python
66
+ from transformers import (
67
+ AutoTokenizer,
68
+ AutoModelForCausalLM,
69
+ GenerationConfig,
70
+ TextStreamer
71
+ )
72
+ import torch
73
+
74
+ tokenizer = AutoTokenizer.from_pretrained("mii-llm/maestrale-chat-v0.4-beta")
75
+ model = AutoModelForCausalLM.from_pretrained("mii-llm/maestrale-chat-v0.4-beta", load_in_8bit=True, device_map="auto")
76
+
77
+ gen = GenerationConfig(
78
+ do_sample=True,
79
+ temperature=0.7,
80
+ repetition_penalty=1.2,
81
+ top_k=50,
82
+ top_p=0.95,
83
+ max_new_tokens=500,
84
+ pad_token_id=tokenizer.eos_token_id,
85
+ eos_token_id=tokenizer.convert_tokens_to_ids("<|im_end|>")
86
+ )
87
+
88
+ streamer = TextStreamer(tokenizer, skip_prompt=True)
89
+
90
+ messages = [
91
+ {"role": "system", "content": "Sei un assistente utile."},
92
+ {"role": "user", "content": "{prompt}"}
93
+ ]
94
+
95
+ with torch.no_grad():
96
+ temp = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
97
+ inputs = tokenizer(temp, return_tensors="pt").to("cuda")
98
+
99
+ _ = model.generate(
100
+ **inputs,
101
+ streamer=streamer,
102
+ generation_config=gen
103
+ )
104
+ ```
105
+
106
+ ## Intended uses & limitations
107
+
108
+ It's a beta version; it's quite `safe`, and it can refuse to answer to toxic questions.
109
+
110
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)