adithya-s-k / adithya-s-k/omniparse
Using the Colab Notebook Gradio App fails
- 主要語言
- Python
- 星號
- 7.9k
- 分支
- 676
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Very interesting project. Tried to spin it up from the Colab Notebook to compare the performance compared to commercial solutions but have been unable to get it to work at all.
The app goes through the steps below then throws an error:
```
Detecting bboxes: 100% 10/10 [00:12<00:00, 1.21s/it]
Recognizing Text: 100% 60/60 [01:39<00:00, 1.66s/it]
Detecting bboxes: 100% 7/7 [00:12<00:00, 1.79s/it]
Finding reading order: 100% 7/7 [00:07<00:00, 1.09s/it]
```
**Here is the Traceback:**
```
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/content/omniparse/omniparse/demo.py", line 193, in parse_document
document_response = response.json()
File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/gradio/queueing.py", line 541, in process_events
response = await route_utils.call_process_api(
File "/usr/local/lib/python3.10/dist-packages/gradio/route_utils.py", line 276, in call_process_api
output = await app.get_blocks().process_api(
File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1928, in process_api
result = await self.call_function(
File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1514, in call_function
prediction = await anyio.to_thread.run_sync(
File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 833, in wrapper
response = f(*args, **kwargs)
File "/content/omniparse/omniparse/demo.py", line 204, in parse_document
raise gr.Error(f"Failed to parse: {e}")
gradio.exceptions.Error: 'Failed to parse: Expecting value: line 1 column 1 (char 0)'
```
Any help is appreciated!
貢獻指南
研究方向
Start with the Colab Notebook reproduction and inspect omniparse/demo.py at parse_document around lines 193-204, where response.json() fails. Trace the response that reaches this point and compare it with the expected document response; done means the notebook's Gradio app parses the document without raising JSONDecodeError.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- jupyter-notebook, python
- 領域
- backend
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100