Spaces:
Running
on
Zero
Running
on
Zero
UI and Model
Browse files1. Simple Dropdown
2. Oldest Purple theme is also good but orange theme is not good in light mode, so shifted to green and lime.
editing mor do not merge now.
app.py
CHANGED
@@ -52,14 +52,23 @@ def write_message_to_user():
|
|
52 |
def respond(
|
53 |
message,
|
54 |
history: list[tuple[str, str]],
|
55 |
-
model,
|
56 |
-
system_message,
|
57 |
-
max_tokens,
|
58 |
-
temperature,
|
59 |
-
top_p,
|
60 |
-
top_k,
|
61 |
-
repeat_penalty,
|
62 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
chat_template = get_messages_formatter_type(model)
|
64 |
llm = Llama(
|
65 |
model_path=f"models/{model}",
|
@@ -160,11 +169,11 @@ demo = gr.ChatInterface(
|
|
160 |
respond,
|
161 |
additional_inputs=[
|
162 |
gr.Dropdown([
|
163 |
-
'Mistral
|
164 |
-
'
|
165 |
-
'
|
166 |
],
|
167 |
-
value="Mistral
|
168 |
label="Model"
|
169 |
),
|
170 |
gr.Textbox(value=web_search_system_prompt, label="System message"),
|
@@ -193,8 +202,8 @@ demo = gr.ChatInterface(
|
|
193 |
),
|
194 |
],
|
195 |
theme=gr.themes.Soft(
|
196 |
-
primary_hue="
|
197 |
-
secondary_hue="
|
198 |
neutral_hue="gray",
|
199 |
font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]).set(
|
200 |
body_background_fill_dark="#0c0505",
|
|
|
52 |
def respond(
|
53 |
message,
|
54 |
history: list[tuple[str, str]],
|
55 |
+
model = 'Mistral-7B-Instruct-v0.3-Q6_K.gguf',
|
56 |
+
system_message = 'Helpful assistant',
|
57 |
+
max_tokens = 2048,
|
58 |
+
temperature = 0.45,
|
59 |
+
top_p = 0.95,
|
60 |
+
top_k = 40,
|
61 |
+
repeat_penalty = 1.1,
|
62 |
):
|
63 |
+
|
64 |
+
if "Mistral" in model:
|
65 |
+
model = 'Mistral-7B-Instruct-v0.3-Q6_K.gguf'
|
66 |
+
elif "Mixtral" in model:
|
67 |
+
model = 'mixtral-8x7b-instruct-v0.1.Q5_K_M.gguf'
|
68 |
+
else:
|
69 |
+
model = 'Meta-Llama-3-8B-Instruct-Q6_K.gguf'
|
70 |
+
yield model
|
71 |
+
|
72 |
chat_template = get_messages_formatter_type(model)
|
73 |
llm = Llama(
|
74 |
model_path=f"models/{model}",
|
|
|
169 |
respond,
|
170 |
additional_inputs=[
|
171 |
gr.Dropdown([
|
172 |
+
'Mistral 7B Instruct v0.3',
|
173 |
+
'Mixtral 8x7b Instruct v0.1',
|
174 |
+
'Llama 3 8B Instruct'
|
175 |
],
|
176 |
+
value="Mistral 7B Instruct v0.3",
|
177 |
label="Model"
|
178 |
),
|
179 |
gr.Textbox(value=web_search_system_prompt, label="System message"),
|
|
|
202 |
),
|
203 |
],
|
204 |
theme=gr.themes.Soft(
|
205 |
+
primary_hue="green",
|
206 |
+
secondary_hue="lime",
|
207 |
neutral_hue="gray",
|
208 |
font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]).set(
|
209 |
body_background_fill_dark="#0c0505",
|