Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -184,7 +184,7 @@ def display_pdf(pdf_url):
|
|
| 184 |
doc = fitz.open(stream=pdf_bytes, filetype="pdf")
|
| 185 |
page = doc[0]
|
| 186 |
|
| 187 |
-
zoom =
|
| 188 |
mat = fitz.Matrix(zoom, zoom)
|
| 189 |
pix = page.get_pixmap(matrix=mat)
|
| 190 |
|
|
@@ -241,26 +241,17 @@ with gr.Blocks(title="# 🌊 Dox the Data Professional's Advisor 🤖", theme=gr
|
|
| 241 |
|
| 242 |
ask_btn = gr.Button("Submit", variant="primary")
|
| 243 |
|
| 244 |
-
# Add this loading indicator component
|
| 245 |
-
loading_indicator = gr.Markdown(
|
| 246 |
-
value="🤔 Dox is thinking...",
|
| 247 |
-
visible=False,
|
| 248 |
-
elem_id="loading_indicator"
|
| 249 |
-
)
|
| 250 |
-
|
| 251 |
-
# Your answer component (initially hidden)
|
| 252 |
answer = gr.Markdown(
|
| 253 |
label="Answer: ",
|
| 254 |
render=True,
|
| 255 |
container=True,
|
| 256 |
-
visible=False, # Start hidden
|
| 257 |
elem_id="answer_markdown"
|
| 258 |
)
|
| 259 |
|
| 260 |
with gr.Column(scale=2):
|
| 261 |
link_state = gr.State()
|
| 262 |
show_btn = gr.Button("Show PDF", visible=False, variant="secondary")
|
| 263 |
-
output_image = gr.Image(label="PDF Preview (Page 1)", visible=False
|
| 264 |
|
| 265 |
# Ask agent functionality
|
| 266 |
ask_btn.click(
|
|
|
|
| 184 |
doc = fitz.open(stream=pdf_bytes, filetype="pdf")
|
| 185 |
page = doc[0]
|
| 186 |
|
| 187 |
+
zoom = 5
|
| 188 |
mat = fitz.Matrix(zoom, zoom)
|
| 189 |
pix = page.get_pixmap(matrix=mat)
|
| 190 |
|
|
|
|
| 241 |
|
| 242 |
ask_btn = gr.Button("Submit", variant="primary")
|
| 243 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
answer = gr.Markdown(
|
| 245 |
label="Answer: ",
|
| 246 |
render=True,
|
| 247 |
container=True,
|
|
|
|
| 248 |
elem_id="answer_markdown"
|
| 249 |
)
|
| 250 |
|
| 251 |
with gr.Column(scale=2):
|
| 252 |
link_state = gr.State()
|
| 253 |
show_btn = gr.Button("Show PDF", visible=False, variant="secondary")
|
| 254 |
+
output_image = gr.Image(label="PDF Preview (Page 1)", visible=False)
|
| 255 |
|
| 256 |
# Ask agent functionality
|
| 257 |
ask_btn.click(
|