Spaces:
Sleeping
Sleeping
Commit
·
a114927
1
Parent(s):
ef1e30c
Update app.py
Browse files
app.py
CHANGED
@@ -41,14 +41,60 @@ def generate(
|
|
41 |
yield output
|
42 |
return output
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
mychatbot = gr.Chatbot(
|
46 |
avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True,)
|
47 |
|
48 |
demo = gr.ChatInterface(fn=generate,
|
|
|
49 |
chatbot=mychatbot,
|
50 |
title="Kamran's Mixtral 8x7b Chat",
|
51 |
retry_btn=None,
|
|
|
52 |
undo_btn=None
|
53 |
)
|
54 |
|
|
|
41 |
yield output
|
42 |
return output
|
43 |
|
44 |
+
|
45 |
+
additional_inputs=[
|
46 |
+
gr.Textbox(
|
47 |
+
label="System Prompt",
|
48 |
+
max_lines=1,
|
49 |
+
interactive=True,
|
50 |
+
),
|
51 |
+
gr.Slider(
|
52 |
+
label="Temperature",
|
53 |
+
value=0.2,
|
54 |
+
minimum=0.0,
|
55 |
+
maximum=1.0,
|
56 |
+
step=0.05,
|
57 |
+
interactive=True,
|
58 |
+
info="Higher values produce more diverse outputs",
|
59 |
+
),
|
60 |
+
gr.Slider(
|
61 |
+
label="Max new tokens",
|
62 |
+
value=512,
|
63 |
+
minimum=0,
|
64 |
+
maximum=1048,
|
65 |
+
step=64,
|
66 |
+
interactive=True,
|
67 |
+
info="The maximum numbers of new tokens",
|
68 |
+
),
|
69 |
+
gr.Slider(
|
70 |
+
label="Top-p (nucleus sampling)",
|
71 |
+
value=0.95,
|
72 |
+
minimum=0.0,
|
73 |
+
maximum=1,
|
74 |
+
step=0.05,
|
75 |
+
interactive=True,
|
76 |
+
info="Higher values sample more low-probability tokens",
|
77 |
+
),
|
78 |
+
gr.Slider(
|
79 |
+
label="Repetition penalty",
|
80 |
+
value=1,
|
81 |
+
minimum=1.0,
|
82 |
+
maximum=2.0,
|
83 |
+
step=0.05,
|
84 |
+
interactive=True,
|
85 |
+
info="Penalize repeated tokens",
|
86 |
+
)
|
87 |
+
]
|
88 |
+
|
89 |
mychatbot = gr.Chatbot(
|
90 |
avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True,)
|
91 |
|
92 |
demo = gr.ChatInterface(fn=generate,
|
93 |
+
additional_inputs=additional_inputs,
|
94 |
chatbot=mychatbot,
|
95 |
title="Kamran's Mixtral 8x7b Chat",
|
96 |
retry_btn=None,
|
97 |
+
concurrency_limit=4,
|
98 |
undo_btn=None
|
99 |
)
|
100 |
|