Update app.py
Browse files
app.py
CHANGED
|
@@ -73,6 +73,7 @@ def load_document(pdf_filename):
|
|
| 73 |
|
| 74 |
return 'Success'
|
| 75 |
|
|
|
|
| 76 |
import gradio as gr
|
| 77 |
import os
|
| 78 |
|
|
@@ -97,17 +98,24 @@ def upload_pdf(file):
|
|
| 97 |
|
| 98 |
|
| 99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
)
|
| 111 |
-
|
| 112 |
-
iface.launch()
|
| 113 |
|
|
|
|
| 73 |
|
| 74 |
return 'Success'
|
| 75 |
|
| 76 |
+
|
| 77 |
import gradio as gr
|
| 78 |
import os
|
| 79 |
|
|
|
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
+
with gr.Blocks() as demo:
|
| 102 |
+
radio = gr.Radio(value='gpt-3.5-turbo', choices=['gpt-3.5-turbo','gpt-4'], label='models')
|
| 103 |
+
chatbot = gr.Chatbot(value=[], elem_id="chatbot").style(height=650)
|
| 104 |
+
with gr.Row():
|
| 105 |
+
with gr.Column(scale=0.70):
|
| 106 |
+
txt = gr.Textbox(
|
| 107 |
+
show_label=False,
|
| 108 |
+
placeholder="Enter text and press enter, or upload an image",
|
| 109 |
+
).style(container=False)
|
| 110 |
|
| 111 |
|
| 112 |
+
# iface = gr.Interface(
|
| 113 |
+
# fn=upload_pdf,
|
| 114 |
+
# inputs="file",
|
| 115 |
+
# outputs="text",
|
| 116 |
+
# title="PDF File Uploader",
|
| 117 |
+
# description="Upload a PDF file and get its filename.",
|
| 118 |
+
# )
|
| 119 |
+
|
| 120 |
+
demo.launch()
|
|
|
|
|
|
|
| 121 |
|