anishde commited on
Commit
ea7aacd
1 Parent(s): 6271832

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -37
app.py CHANGED
@@ -63,42 +63,42 @@ def generate_response(history, query):
63
  history[-1][-1] += char
64
  yield history, ''
65
 
66
- if __name__ == "__main__":
67
- with gr.Blocks() as demo:
68
- # Create a Gradio block
69
-
70
- with gr.Column():
71
-
72
-
73
- with gr.Row():
74
- chatbot = gr.Chatbot(value=[], elem_id='chatbot')
75
- # chatbot = gr.Chatbot(value=[], elem_id='chatbot').style(height=570)
76
-
77
  with gr.Row():
78
- with gr.Column(scale=2):
79
- txt = gr.Textbox(
80
- show_label=False,
81
- placeholder="Enter text and press enter"
82
- )
83
- # ).style(container=False)
84
-
85
- with gr.Column(scale=1):
86
- submit_btn = gr.Button('Submit')
87
-
88
-
89
-
90
- # Event handler for submitting text and generating response
91
- submit_btn.click(
92
- fn=add_text,
93
- inputs=[chatbot, txt],
94
- outputs=[chatbot],
95
- queue=False
96
- ).success(
97
- fn=generate_response,
98
- inputs=[chatbot, txt],
99
- outputs=[chatbot, txt]
100
- )
101
-
102
- demo.queue()
103
- demo.launch()
 
 
 
 
 
104
 
 
63
  history[-1][-1] += char
64
  yield history, ''
65
 
66
+ with gr.Blocks() as demo:
67
+ # Create a Gradio block
68
+
69
+ with gr.Column():
70
+
71
+
 
 
 
 
 
72
  with gr.Row():
73
+ chatbot = gr.Chatbot(value=[], elem_id='chatbot')
74
+ # chatbot = gr.Chatbot(value=[], elem_id='chatbot').style(height=570)
75
+
76
+ with gr.Row():
77
+ with gr.Column(scale=2):
78
+ txt = gr.Textbox(
79
+ show_label=False,
80
+ placeholder="Enter text and press enter"
81
+ )
82
+ # ).style(container=False)
83
+
84
+ with gr.Column(scale=1):
85
+ submit_btn = gr.Button('Submit')
86
+
87
+
88
+
89
+ # Event handler for submitting text and generating response
90
+ submit_btn.click(
91
+ fn=add_text,
92
+ inputs=[chatbot, txt],
93
+ outputs=[chatbot],
94
+ queue=False
95
+ ).success(
96
+ fn=generate_response,
97
+ inputs=[chatbot, txt],
98
+ outputs=[chatbot, txt]
99
+ )
100
+
101
+ if __name__ == "__main__":
102
+ demo.queue()
103
+ demo.launch()
104