openfree commited on
Commit
0dfd273
ยท
verified ยท
1 Parent(s): e4d39de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -3
app.py CHANGED
@@ -156,6 +156,8 @@ css = """
156
  footer {visibility: hidden}
157
  """
158
 
 
 
159
  with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css, title="EveryChat ๐Ÿค–") as demo:
160
  gr.HTML(
161
  """
@@ -168,14 +170,20 @@ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css, title="EveryChat
168
 
169
  with gr.Row():
170
  with gr.Column(scale=2):
171
- chatbot = gr.Chatbot(height=600, label="Chat Interface ๐Ÿ’ฌ")
 
 
 
 
172
  msg = gr.Textbox(
173
  label="Type your message",
174
  show_label=False,
175
  placeholder="Ask me anything about the uploaded file... ๐Ÿ’ญ",
176
  container=False
177
  )
178
- clear = gr.ClearButton([msg, chatbot], label="Clear Chat ๐Ÿ—‘๏ธ")
 
 
179
 
180
  with gr.Column(scale=1):
181
  model_name = gr.Radio(
@@ -210,6 +218,17 @@ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css, title="EveryChat
210
  [msg]
211
  )
212
 
 
 
 
 
 
 
 
 
 
 
 
213
  # Auto-analysis on file upload
214
  file_upload.change(
215
  chat,
@@ -232,4 +251,4 @@ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css, title="EveryChat
232
  )
233
 
234
  if __name__ == "__main__":
235
- demo.launch()
 
156
  footer {visibility: hidden}
157
  """
158
 
159
+ # ... (์ด์ „ ์ฝ”๋“œ ๋™์ผ)
160
+
161
  with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css, title="EveryChat ๐Ÿค–") as demo:
162
  gr.HTML(
163
  """
 
170
 
171
  with gr.Row():
172
  with gr.Column(scale=2):
173
+ chatbot = gr.Chatbot(
174
+ height=600,
175
+ label="Chat Interface ๐Ÿ’ฌ",
176
+ type="messages" # ๊ฒฝ๊ณ  ํ•ด๊ฒฐ์„ ์œ„ํ•ด type ์ง€์ •
177
+ )
178
  msg = gr.Textbox(
179
  label="Type your message",
180
  show_label=False,
181
  placeholder="Ask me anything about the uploaded file... ๐Ÿ’ญ",
182
  container=False
183
  )
184
+ with gr.Row():
185
+ clear = gr.ClearButton([msg, chatbot]) # label ์ œ๊ฑฐ
186
+ send = gr.Button("Send ๐Ÿ“ค")
187
 
188
  with gr.Column(scale=1):
189
  model_name = gr.Radio(
 
218
  [msg]
219
  )
220
 
221
+ send.click( # ์ „์†ก ๋ฒ„ํŠผ ์ด๋ฒคํŠธ ์ถ”๊ฐ€
222
+ chat,
223
+ inputs=[msg, chatbot, file_upload, model_name, system_message, max_tokens, temperature, top_p],
224
+ outputs=[msg, chatbot],
225
+ queue=True
226
+ ).then(
227
+ lambda: gr.update(interactive=True),
228
+ None,
229
+ [msg]
230
+ )
231
+
232
  # Auto-analysis on file upload
233
  file_upload.change(
234
  chat,
 
251
  )
252
 
253
  if __name__ == "__main__":
254
+ demo.launch()