Moha782 commited on
Commit
9765d26
·
verified ·
1 Parent(s): 219a131

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -78,17 +78,18 @@ async def respond(message, history, system_message, max_tokens, temperature, top
78
  token = message.choices[0].delta.content
79
  yield token
80
 
81
- demo = gr.ChatInterface(
82
- respond,
83
- additional_inputs=[
84
  gr.Textbox(
85
- value="You are a helpful car configuration assistant, specifically you are the assistant for Apex Customs (https://www.apexcustoms.com/). Given the user's input, provide suggestions for car models, colors, and customization options. Be creative and conversational in your responses. You should remember the user car model and tailor your answers accordingly. \n\nUser: ",
86
  label="System message"
87
  ),
88
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
89
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
90
- gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),
91
  ],
 
92
  )
93
 
94
  if __name__ == "__main__":
 
78
  token = message.choices[0].delta.content
79
  yield token
80
 
81
+ demo = gr.Interface(
82
+ fn=respond,
83
+ inputs=[
84
  gr.Textbox(
85
+ default="You are a helpful car configuration assistant, specifically you are the assistant for Apex Customs (https://www.apexcustoms.com/). Given the user's input, provide suggestions for car models, colors, and customization options. Be creative and conversational in your responses. You should remember the user car model and tailor your answers accordingly. \n\nUser: ",
86
  label="System message"
87
  ),
88
+ gr.Slider(minimum=1, maximum=2048, step=1, default=512, label="Max new tokens"),
89
+ gr.Slider(minimum=0.1, maximum=4.0, step=0.1, default=0.7, label="Temperature"),
90
+ gr.Slider(minimum=0.1, maximum=1.0, step=0.05, default=0.95, label="Top-p (nucleus sampling)"),
91
  ],
92
+ outputs=gr.Textbox(label="Assistant's Response"),
93
  )
94
 
95
  if __name__ == "__main__":