dammy commited on
Commit
59b084c
·
1 Parent(s): 1288197

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -15
app.py CHANGED
@@ -94,28 +94,40 @@ def upload_pdf(file):
94
  return f"An error occurred: {e}"
95
 
96
 
97
-
98
-
99
-
100
  with gr.Blocks() as demo:
101
 
102
  btn = gr.UploadButton("Upload a PDF", file_types=[".pdf"])
103
  output = gr.Textbox(label="Output Box", style={"height": "100px", "margin-top": "20px"})
104
- chatbot = gr.Chatbot(height=240, placeholder="Ask me anything...", style={"margin-top": "20px"})
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
- with gr.Row(style={"margin-top": "20px"}):
107
- with gr.Column(scale=0.70):
108
- # Styled Textbox
109
- txt = gr.Textbox(
110
- show_label=False,
111
- placeholder="Enter a question",
112
- style={"width": "100%", "height": "100px", "margin-bottom": "10px"}
113
- )
114
 
115
 
116
- # Event handler for uploading a PDF
117
- btn.upload(fn=upload_pdf, inputs=[btn], outputs=[output])
118
- txt.submit(run_query, [btn, chatbot, txt], [chatbot, txt])
119
 
120
 
121
  gr.close_all()
 
94
  return f"An error occurred: {e}"
95
 
96
 
 
 
 
97
  with gr.Blocks() as demo:
98
 
99
  btn = gr.UploadButton("Upload a PDF", file_types=[".pdf"])
100
  output = gr.Textbox(label="Output Box", style={"height": "100px", "margin-top": "20px"})
101
+ chatbot = gr.Chatbot(height=240)
102
+
103
+ with gr.Row():
104
+ with gr.Column(scale=0.70):
105
+ txt = gr.Textbox(
106
+ show_label=False,
107
+ placeholder="Enter a question",
108
+ )
109
+
110
+
111
+
112
+ # with gr.Blocks() as demo:
113
+
114
+ # btn = gr.UploadButton("Upload a PDF", file_types=[".pdf"])
115
+ # output = gr.Textbox(label="Output Box", style={"height": "100px", "margin-top": "20px"})
116
+ # chatbot = gr.Chatbot(height=240, placeholder="Ask me anything...", style={"margin-top": "20px"})
117
 
118
+ # with gr.Row(style={"margin-top": "20px"}):
119
+ # with gr.Column(scale=0.70):
120
+ # # Styled Textbox
121
+ # txt = gr.Textbox(
122
+ # show_label=False,
123
+ # placeholder="Enter a question",
124
+ # style={"width": "100%", "height": "100px", "margin-bottom": "10px"}
125
+ # )
126
 
127
 
128
+ # # Event handler for uploading a PDF
129
+ # btn.upload(fn=upload_pdf, inputs=[btn], outputs=[output])
130
+ # txt.submit(run_query, [btn, chatbot, txt], [chatbot, txt])
131
 
132
 
133
  gr.close_all()