Spaces:
Sleeping
Sleeping
prithivMLmods
commited on
Commit
•
6cb637b
1
Parent(s):
cfbffd9
Update app.py
Browse files
app.py
CHANGED
@@ -107,26 +107,19 @@ def respond(
|
|
107 |
response += token
|
108 |
yield response
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
respond,
|
120 |
-
additional_inputs=[
|
121 |
-
system_message,
|
122 |
-
max_tokens,
|
123 |
-
temperature,
|
124 |
-
top_p,
|
125 |
],
|
126 |
-
|
127 |
css=css,
|
128 |
theme="allenai/gradio-theme",
|
129 |
-
secondary_inputs=[mood_choice], # Adding mood_choice separately for visibility
|
130 |
)
|
131 |
|
132 |
if __name__ == "__main__":
|
|
|
107 |
response += token
|
108 |
yield response
|
109 |
|
110 |
+
demo = gr.Interface(
|
111 |
+
fn=respond,
|
112 |
+
inputs=[
|
113 |
+
gr.Textbox(label="Input message"),
|
114 |
+
gr.Textbox(value="", label="System message", visible=False),
|
115 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens", visible=False),
|
116 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature", visible=False),
|
117 |
+
gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-P", visible=False),
|
118 |
+
gr.Dropdown(choices=list(mood_prompts.keys()), label="Mood", value="Casual"),
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
],
|
120 |
+
outputs=gr.Textbox(label="Response"),
|
121 |
css=css,
|
122 |
theme="allenai/gradio-theme",
|
|
|
123 |
)
|
124 |
|
125 |
if __name__ == "__main__":
|