Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,49 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def respond(msg, history, *args):
|
4 |
+
return "response"
|
5 |
+
|
6 |
+
demo = gr.ChatInterface(
|
7 |
+
respond,
|
8 |
+
additional_inputs=[
|
9 |
+
gr.Dropdown([
|
10 |
+
'Meta-Llama-3-70B-Instruct-Q3_K_M.gguf',
|
11 |
+
'gemma-2-27b-it-Q8_0.gguf'
|
12 |
+
],
|
13 |
+
value="gemma-2-27b-it-Q8_0.gguf",
|
14 |
+
label="Model"
|
15 |
+
),
|
16 |
+
gr.Textbox(value="You are a helpful assistant.", label="System message"),
|
17 |
+
gr.Slider(minimum=1, maximum=4096, value=2048, step=1, label="Max tokens"),
|
18 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
19 |
+
gr.Slider(
|
20 |
+
minimum=0.1,
|
21 |
+
maximum=1.0,
|
22 |
+
value=0.95,
|
23 |
+
step=0.05,
|
24 |
+
label="Top-p",
|
25 |
+
),
|
26 |
+
gr.Slider(
|
27 |
+
minimum=0,
|
28 |
+
maximum=100,
|
29 |
+
value=40,
|
30 |
+
step=1,
|
31 |
+
label="Top-k",
|
32 |
+
),
|
33 |
+
gr.Slider(
|
34 |
+
minimum=0.0,
|
35 |
+
maximum=2.0,
|
36 |
+
value=1.1,
|
37 |
+
step=0.1,
|
38 |
+
label="Repetition penalty",
|
39 |
+
),
|
40 |
+
],
|
41 |
+
description="Llama-cpp-agent: Chat multi llm selection",
|
42 |
+
chatbot=gr.Chatbot(
|
43 |
+
scale=1,
|
44 |
+
placeholder="PLACEHOLDER",
|
45 |
+
show_copy_button=True
|
46 |
+
)
|
47 |
+
)
|
48 |
|
49 |
demo.launch()
|