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