Spaces:
Sleeping
Sleeping
prithivMLmods
commited on
Commit
•
8b3f75e
1
Parent(s):
37fb658
Update app.py
Browse files
app.py
CHANGED
@@ -107,23 +107,25 @@ 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 |
-
|
126 |
-
|
|
|
|
|
127 |
|
128 |
if __name__ == "__main__":
|
129 |
demo.launch()
|
|
|
107 |
response += token
|
108 |
yield response
|
109 |
|
110 |
+
# Layout with separate row for Mood
|
111 |
+
with gr.Blocks(css=css, theme="allenai/gradio-theme") as demo:
|
112 |
+
with gr.Row():
|
113 |
+
system_message = gr.Textbox(value="", label="System message")
|
114 |
+
max_tokens = gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens")
|
115 |
+
with gr.Row():
|
116 |
+
temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
|
117 |
+
top_p = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-P")
|
118 |
+
with gr.Row():
|
119 |
+
mood = gr.Dropdown(
|
120 |
+
choices=list(mood_prompts.keys()),
|
121 |
+
label="Mood",
|
122 |
+
value="Casual"
|
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()
|