Files changed (1) hide show
  1. app.py +211 -0
app.py CHANGED
@@ -5,3 +5,214 @@ def greet(name):
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
8
+
9
+ MODELS=`[
10
+
11
+ {
12
+
13
+ "name" : "mistralai/Mixtral-8x7B-Instruct-v0.1",
14
+
15
+ "description" : "The latest MoE model from Mistral AI! 8x7B and outperforms Llama 2 70B in most benchmarks.",
16
+
17
+ "websiteUrl" : "https://mistral.ai/news/mixtral-of-experts/",
18
+
19
+ "preprompt" : "",
20
+
21
+ "chatPromptTemplate": "<s> {{#each messages}}{{#ifUser}}[INST]{{#if @first}}{{#if @root.preprompt}}{{@root.preprompt}}\n{{/if}}{{/if}} {{content}} [/INST]{{/ifUser}}{{#ifAssistant}} {{content}}</s> {{/ifAssistant}}{{/each}}",
22
+
23
+ "parameters" : {
24
+
25
+ "temperature" : 0.6,
26
+
27
+ "top_p" : 0.95,
28
+
29
+ "repetition_penalty" : 1.2,
30
+
31
+ "top_k" : 50,
32
+
33
+ "truncate" : 24576,
34
+
35
+ "max_new_tokens" : 8192,
36
+
37
+ "stop" : ["</s>"]
38
+
39
+ },
40
+
41
+ "promptExamples" : [
42
+
43
+ {
44
+
45
+ "title": "Write an email from bullet list",
46
+
47
+ "prompt": "As a restaurant owner, write a professional email to the supplier to get these products every week: \n\n- Wine (x10)\n- Eggs (x24)\n- Bread (x12)"
48
+
49
+ }, {
50
+
51
+ "title": "Code a snake game",
52
+
53
+ "prompt": "Code a basic snake game in python, give explanations for each step."
54
+
55
+ }, {
56
+
57
+ "title": "Assist in a task",
58
+
59
+ "prompt": "How do I make a delicious lemon cheesecake?"
60
+
61
+ }
62
+
63
+ ]
64
+
65
+ },
66
+
67
+ {
68
+
69
+ "name": "meta-llama/Llama-2-70b-chat-hf",
70
+
71
+ "description": "The latest and biggest model from Meta, fine-tuned for chat.",
72
+
73
+ "websiteUrl": "https://ai.meta.com/llama/",
74
+
75
+ "userMessageToken": "",
76
+
77
+ "userMessageEndToken": " [/INST] ",
78
+
79
+ "assistantMessageToken": "",
80
+
81
+ "assistantMessageEndToken": " </s><s>[INST] ",
82
+
83
+ "preprompt": " ",
84
+
85
+ "chatPromptTemplate" : "<s>[INST] <<SYS>>\n{{preprompt}}\n<</SYS>>\n\n{{#each messages}}{{#ifUser}}{{content}} [/INST] {{/ifUser}}{{#ifAssistant}}{{content}} </s><s>[INST] {{/ifAssistant}}{{/each}}",
86
+
87
+ "promptExamples": [
88
+
89
+ {
90
+
91
+ "title": "Write an email from bullet list",
92
+
93
+ "prompt": "As a restaurant owner, write a professional email to the supplier to get these products every week: \n\n- Wine (x10)\n- Eggs (x24)\n- Bread (x12)"
94
+
95
+ }, {
96
+
97
+ "title": "Code a snake game",
98
+
99
+ "prompt": "Code a basic snake game in python, give explanations for each step."
100
+
101
+ }, {
102
+
103
+ "title": "Assist in a task",
104
+
105
+ "prompt": "How do I make a delicious lemon cheesecake?"
106
+
107
+ }
108
+
109
+ ],
110
+
111
+ "parameters": {
112
+
113
+ "temperature": 0.1,
114
+
115
+ "top_p": 0.95,
116
+
117
+ "repetition_penalty": 1.2,
118
+
119
+ "top_k": 50,
120
+
121
+ "truncate": 3072,
122
+
123
+ "max_new_tokens": 1024,
124
+
125
+ "stop" : ["</s>", " </s><s>[INST] "]
126
+
127
+ }
128
+
129
+ },
130
+
131
+ {
132
+
133
+ "name" : "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
134
+
135
+ "description" : "Nous Hermes 2 Mixtral 8x7B DPO is the new flagship Nous Research model trained over the Mixtral 8x7B MoE LLM.",
136
+
137
+ "websiteUrl" : "https://nousresearch.com/",
138
+
139
+ "chatPromptTemplate" : "<|im_start|>system\n{{#if @root.preprompt}}{{@root.preprompt}}<|im_end|>\n{{/if}}{{#each messages}}{{#ifUser}}<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n{{/ifUser}}{{#ifAssistant}}{{content}}<|im_end|>\n{{/ifAssistant}}{{/each}}",
140
+
141
+ "promptExamples": [
142
+
143
+ {
144
+
145
+ "title": "Write an email from bullet list",
146
+
147
+ "prompt": "As a restaurant owner, write a professional email to the supplier to get these products every week: \n\n- Wine (x10)\n- Eggs (x24)\n- Bread (x12)"
148
+
149
+ }, {
150
+
151
+ "title": "Code a snake game",
152
+
153
+ "prompt": "Code a basic snake game in python, give explanations for each step."
154
+
155
+ }, {
156
+
157
+ "title": "Assist in a task",
158
+
159
+ "prompt": "How do I make a delicious lemon cheesecake?"
160
+
161
+ }
162
+
163
+ ],
164
+
165
+ "parameters": {
166
+
167
+ "temperature": 0.7,
168
+
169
+ "top_p": 0.95,
170
+
171
+ "repetition_penalty": 1,
172
+
173
+ "top_k": 50,
174
+
175
+ "truncate": 24576,
176
+
177
+ "max_new_tokens": 2048,
178
+
179
+ "stop": ["<|im_end|>"]
180
+
181
+ }
182
+
183
+ },
184
+
185
+ {
186
+
187
+ "name": "codellama/CodeLlama-34b-Instruct-hf",
188
+
189
+ "displayName": "codellama/CodeLlama-34b-Instruct-hf",
190
+
191
+ "description": "Code Llama, a state of the art code model from Meta.",
192
+
193
+ "websiteUrl": "https://about.fb.com/news/2023/08/code-llama-ai-for-coding/",
194
+
195
+ "userMessageToken": "",
196
+
197
+ "userMessageEndToken": " [/INST] ",
198
+
199
+ "assistantMessageToken": "",
200
+
201
+ "assistantMessageEndToken": " </s><s>[INST] ",
202
+
203
+ "preprompt": " ",
204
+
205
+ "chatPromptTemplate" : "<s>[INST] <<SYS>>\n{{preprompt}}\n<</SYS>>\n\n{{#each messages}}{{#ifUser}}{{content}} [/INST] {{/ifUser}}{{#ifAssistant}}{{content}} </s><s>[INST] {{/ifAssistant}}{{/each}}",
206
+
207
+ "promptExamples": [
208
+
209
+ {
210
+
211
+ "title": "Fibonacci in Python",
212
+
213
+ "prompt": "Write a python function to calculate the nth fibonacci number."
214
+
215
+ }, {
216
+
217
+ "title": "JavaScript promises",
218
+