Spaces:
Build error
Build error
Ankur Goyal
commited on
Commit
•
60bdd81
1
Parent(s):
99d94a6
Fix dropzone and RGB issue while loading
Browse files- app.py +6 -3
- requirements.txt +1 -1
app.py
CHANGED
@@ -151,7 +151,6 @@ def process_question(question, document, model=list(CHECKPOINTS.keys())[0]):
|
|
151 |
|
152 |
def load_example_document(img, question, model):
|
153 |
if img is not None:
|
154 |
-
print(f"LOADING EXAMPLE {question}")
|
155 |
document = ImageDocument(Image.fromarray(img))
|
156 |
preview, answer = process_question(question, document, model)
|
157 |
return document, question, preview, gr.update(visible=True), answer
|
@@ -272,9 +271,11 @@ with gr.Blocks(css=CSS) as demo:
|
|
272 |
gr.update(visible=False, value=None),
|
273 |
gr.update(visible=False),
|
274 |
None,
|
|
|
|
|
275 |
),
|
276 |
inputs=img_clear_button,
|
277 |
-
outputs=[image, document, output, img_clear_button, example_image],
|
278 |
)
|
279 |
clear_button.click(
|
280 |
lambda _: (
|
@@ -283,9 +284,11 @@ with gr.Blocks(css=CSS) as demo:
|
|
283 |
None,
|
284 |
gr.update(visible=False, value=None),
|
285 |
None,
|
|
|
|
|
286 |
),
|
287 |
inputs=clear_button,
|
288 |
-
outputs=[image, document, question, output, example_image],
|
289 |
)
|
290 |
|
291 |
upload.change(
|
|
|
151 |
|
152 |
def load_example_document(img, question, model):
|
153 |
if img is not None:
|
|
|
154 |
document = ImageDocument(Image.fromarray(img))
|
155 |
preview, answer = process_question(question, document, model)
|
156 |
return document, question, preview, gr.update(visible=True), answer
|
|
|
271 |
gr.update(visible=False, value=None),
|
272 |
gr.update(visible=False),
|
273 |
None,
|
274 |
+
None,
|
275 |
+
None,
|
276 |
),
|
277 |
inputs=img_clear_button,
|
278 |
+
outputs=[image, document, output, img_clear_button, example_image, upload, url],
|
279 |
)
|
280 |
clear_button.click(
|
281 |
lambda _: (
|
|
|
284 |
None,
|
285 |
gr.update(visible=False, value=None),
|
286 |
None,
|
287 |
+
None,
|
288 |
+
None,
|
289 |
),
|
290 |
inputs=clear_button,
|
291 |
+
outputs=[image, document, question, output, example_image, upload, url],
|
292 |
)
|
293 |
|
294 |
upload.change(
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
torch
|
2 |
git+https://github.com/huggingface/transformers.git@21f6f58721dd9154357576be6de54eefef1f1818
|
3 |
-
git+https://github.com/impira/docquery.git@
|
4 |
sentencepiece
|
|
|
1 |
torch
|
2 |
git+https://github.com/huggingface/transformers.git@21f6f58721dd9154357576be6de54eefef1f1818
|
3 |
+
git+https://github.com/impira/docquery.git@0e978aa3a4283814e856c69d2017ad521088a836
|
4 |
sentencepiece
|