openfree commited on
Commit
b45e256
โ€ข
1 Parent(s): 1fd4ab2

Update app.py

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