cloudyu commited on
Commit
629d436
·
verified ·
1 Parent(s): 5a5d675

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +182 -0
README.md ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ model-index:
4
+ - name: Yi-9Bx2-MOE
5
+ results:
6
+ - task:
7
+ type: text-generation
8
+ name: Text Generation
9
+ dataset:
10
+ name: AI2 Reasoning Challenge (25-Shot)
11
+ type: ai2_arc
12
+ config: ARC-Challenge
13
+ split: test
14
+ args:
15
+ num_few_shot: 25
16
+ metrics:
17
+ - type: acc_norm
18
+ value: 71.25
19
+ name: normalized accuracy
20
+ source:
21
+ url: >-
22
+ https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=cloudyu/Mixtral_7Bx2_MoE
23
+ name: Open LLM Leaderboard
24
+ - task:
25
+ type: text-generation
26
+ name: Text Generation
27
+ dataset:
28
+ name: HellaSwag (10-Shot)
29
+ type: hellaswag
30
+ split: validation
31
+ args:
32
+ num_few_shot: 10
33
+ metrics:
34
+ - type: acc_norm
35
+ value: 87.45
36
+ name: normalized accuracy
37
+ source:
38
+ url: >-
39
+ https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=cloudyu/Mixtral_7Bx2_MoE
40
+ name: Open LLM Leaderboard
41
+ - task:
42
+ type: text-generation
43
+ name: Text Generation
44
+ dataset:
45
+ name: MMLU (5-Shot)
46
+ type: cais/mmlu
47
+ config: all
48
+ split: test
49
+ args:
50
+ num_few_shot: 5
51
+ metrics:
52
+ - type: acc
53
+ value: 64.98
54
+ name: accuracy
55
+ source:
56
+ url: >-
57
+ https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=cloudyu/Mixtral_7Bx2_MoE
58
+ name: Open LLM Leaderboard
59
+ - task:
60
+ type: text-generation
61
+ name: Text Generation
62
+ dataset:
63
+ name: TruthfulQA (0-shot)
64
+ type: truthful_qa
65
+ config: multiple_choice
66
+ split: validation
67
+ args:
68
+ num_few_shot: 0
69
+ metrics:
70
+ - type: mc2
71
+ value: 67.23
72
+ source:
73
+ url: >-
74
+ https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=cloudyu/Mixtral_7Bx2_MoE
75
+ name: Open LLM Leaderboard
76
+ - task:
77
+ type: text-generation
78
+ name: Text Generation
79
+ dataset:
80
+ name: Winogrande (5-shot)
81
+ type: winogrande
82
+ config: winogrande_xl
83
+ split: validation
84
+ args:
85
+ num_few_shot: 5
86
+ metrics:
87
+ - type: acc
88
+ value: 81.22
89
+ name: accuracy
90
+ source:
91
+ url: >-
92
+ https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=cloudyu/Mixtral_7Bx2_MoE
93
+ name: Open LLM Leaderboard
94
+ - task:
95
+ type: text-generation
96
+ name: Text Generation
97
+ dataset:
98
+ name: GSM8k (5-shot)
99
+ type: gsm8k
100
+ config: main
101
+ split: test
102
+ args:
103
+ num_few_shot: 5
104
+ metrics:
105
+ - type: acc
106
+ value: 68.46
107
+ name: accuracy
108
+ source:
109
+ url: >-
110
+ https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=cloudyu/Mixtral_7Bx2_MoE
111
+ name: Open LLM Leaderboard
112
+ ---
113
+
114
+
115
+ # Mixtral MOE 2x7B
116
+
117
+
118
+
119
+ MoE of the following models :
120
+
121
+
122
+ * [byroneverson/Yi-1.5-9B-Chat-16K-abliterated](https://huggingface.co/byroneverson/Yi-1.5-9B-Chat-16K-abliterated)
123
+ * [BAAI/Infinity-Instruct-3M-0625-Yi-1.5-9B](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Yi-1.5-9B)
124
+
125
+
126
+ * metrics:
127
+ Average 73.43
128
+ ARC 71.25
129
+ HellaSwag 87.45
130
+
131
+ gpu code example
132
+
133
+ ```
134
+ import torch
135
+ from transformers import AutoTokenizer, AutoModelForCausalLM
136
+ import math
137
+
138
+ ## v2 models
139
+ model_path = "/cloudyu/Yi-9Bx2-MOE"
140
+
141
+ tokenizer = AutoTokenizer.from_pretrained(model_path, use_default_system_prompt=False)
142
+ model = AutoModelForCausalLM.from_pretrained(
143
+ model_path, torch_dtype=torch.float32, device_map='auto',local_files_only=False, load_in_4bit=True
144
+ )
145
+ print(model)
146
+ prompt = input("please input prompt:")
147
+ while len(prompt) > 0:
148
+ input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to("cuda")
149
+
150
+ generation_output = model.generate(
151
+ input_ids=input_ids, max_new_tokens=500,repetition_penalty=1.2
152
+ )
153
+ print(tokenizer.decode(generation_output[0]))
154
+ prompt = input("please input prompt:")
155
+ ```
156
+
157
+ CPU example
158
+
159
+ ```
160
+ import torch
161
+ from transformers import AutoTokenizer, AutoModelForCausalLM
162
+ import math
163
+
164
+ ## v2 models
165
+ model_path = "/cloudyu/Yi-9Bx2-MOE"
166
+
167
+ tokenizer = AutoTokenizer.from_pretrained(model_path, use_default_system_prompt=False)
168
+ model = AutoModelForCausalLM.from_pretrained(
169
+ model_path, torch_dtype=torch.float32, device_map='cpu',local_files_only=False
170
+ )
171
+ print(model)
172
+ prompt = input("please input prompt:")
173
+ while len(prompt) > 0:
174
+ input_ids = tokenizer(prompt, return_tensors="pt").input_ids
175
+
176
+ generation_output = model.generate(
177
+ input_ids=input_ids, max_new_tokens=500,repetition_penalty=1.2
178
+ )
179
+ print(tokenizer.decode(generation_output[0]))
180
+ prompt = input("please input prompt:")
181
+
182
+ ```