prithivMLmods commited on
Commit
a864a70
1 Parent(s): 8b3f75e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -19
app.py CHANGED
@@ -107,25 +107,20 @@ def respond(
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()
 
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()