Update app.py
Browse files
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(
|
|
|
|
|
|
|
|
|
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 |
-
|
|
|
|
|
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()
|