Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -72,7 +72,16 @@ def predict(message, history):
72
  partial_message = partial_message + chunk['choices'][0]['delta']['content']
73
  yield partial_message
74
 
75
- demo = gr.ChatInterface(predict).queue()
 
 
 
 
 
 
 
 
 
76
 
77
  if __name__ == "__main__":
78
  demo.launch()
 
72
  partial_message = partial_message + chunk['choices'][0]['delta']['content']
73
  yield partial_message
74
 
75
+ # Adjust the Gradio interface for a chatbot
76
+ demo = gr.Interface(
77
+ fn=predict,
78
+ inputs=[
79
+ gr.Textbox(label="Message", placeholder="Enter your message"),
80
+ gr.State(label="Conversation History") # State is used to manage history
81
+ ],
82
+ outputs=gr.Textbox(label="Response"),
83
+ live=True
84
+ ).queue()
85
 
86
  if __name__ == "__main__":
87
  demo.launch()