Spaces:
Sleeping
Sleeping
prithivMLmods
commited on
Commit
•
a864a70
1
Parent(s):
8b3f75e
Update app.py
Browse files
app.py
CHANGED
@@ -107,25 +107,20 @@ def respond(
|
|
107 |
response += token
|
108 |
yield response
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
gr.ChatInterface(
|
126 |
-
fn=respond,
|
127 |
-
inputs=[system_message, max_tokens, temperature, top_p, mood],
|
128 |
-
)
|
129 |
|
130 |
if __name__ == "__main__":
|
131 |
demo.launch()
|
|
|
107 |
response += token
|
108 |
yield response
|
109 |
|
110 |
+
demo = gr.ChatInterface(
|
111 |
+
respond,
|
112 |
+
additional_inputs=[
|
113 |
+
gr.Row(gr.Textbox(value="", label="System message")),
|
114 |
+
gr.Row(
|
115 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
116 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
117 |
+
gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-P")
|
118 |
+
),
|
119 |
+
gr.Row(gr.Dropdown(choices=list(mood_prompts.keys()), label="Mood", value="Casual")),
|
120 |
+
],
|
121 |
+
css=css,
|
122 |
+
theme="allenai/gradio-theme",
|
123 |
+
)
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
if __name__ == "__main__":
|
126 |
demo.launch()
|