adithya-s-k / omniparse

Ingest, parse, and optimize any data format ➡️ from documents to multimedia ➡️ for enhanced compatibility with GenAI frameworks
https://docs.cognitivelab.in
GNU General Public License v3.0
4.37k stars 350 forks source link

[Docker Desktop] Failed to establish a new connection: [Errno 111] Connection refused #22

Open filippotoso opened 2 weeks ago

filippotoso commented 2 weeks ago

I'm trying to use this tool on Windows 11 using the following docker commands:

docker pull savatar101/omniparse:0.1
docker run --gpus all -p 9001:8000 savatar101/omniparse:0.1

The startup process works fine:

Microsoft Windows [Versione 10.0.22621.3447]
(c) Microsoft Corporation. Tutti i diritti riservati.

D:\User\Desktop>docker run --gpus all -p 9001:8000 savatar101/omniparse:0.1

==========
== CUDA ==
==========

CUDA Version 11.8.0

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_fields.py:161: UserWarning: Field "model_list" has conflict with protected namespace "model_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
  warnings.warn(

       .88888.                      oo  888888ba
      d8'   `8b                         88    `8b
      88     88 88d8b.d8b. 88d888b. dP a88aaaa8P' .d8888b. 88d888b. .d8888b. .d8888b.
      88     88 88'`88'`88 88'  `88 88  88        88'  `88 88'  `88 Y8ooooo. 88ooood8
      Y8.   .8P 88  88  88 88    88 88  88        88.  .88 88             88 88.  ...
       `8888P'  dP  dP  dP dP    dP dP  dP        `88888P8 dP       `88888P' `88888P'

Created by Adithya S K : https://twitter.com/adithya_s_k

[LOG] ✅ Loading OCR Model
Loaded detection model vikp/surya_det2 on device cuda with dtype torch.float16
Loaded detection model vikp/surya_layout2 on device cuda with dtype torch.float16
Loaded reading order model vikp/surya_order on device cuda with dtype torch.float16
Loaded recognition model vikp/surya_rec on device cuda with dtype torch.float16
Loaded texify model to cuda with torch.float16 dtype
[LOG] ✅ Loading Vision Model
A new version of the following files was downloaded from https://huggingface.co/microsoft/Florence-2-base:
- configuration_florence2.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
A new version of the following files was downloaded from https://huggingface.co/microsoft/Florence-2-base:
- modeling_florence2.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
A new version of the following files was downloaded from https://huggingface.co/microsoft/Florence-2-base:
- processing_florence2.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
[LOG] ✅ Loading Audio Model
100%|███████████████████████████████████████| 461M/461M [00:11<00:00, 42.9MiB/s]
[LOG] ✅ Loading Web Crawler
INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)

I can access the web UI at http://localhost:9001/

But when I try to parse a document or a website I get the following error:

Error
"HTTP error occurred: HTTPConnectionPool(host='localhost', port=9001): Max retries exceeded with url: /parse_website/parse?url=https://toso.dev/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f45c23beb00>: Failed to establish a new connection: [Errno 111] Connection refused'))"

This is the traceback:

INFO:     172.17.0.1:43888 - "GET /queue/data?session_hash=9egxcv2ykhv HTTP/1.1" 200 OK
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 196, in _new_conn
    sock = connection.create_connection(
  File "/usr/local/lib/python3.10/dist-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/usr/local/lib/python3.10/dist-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
  File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 398, in request
    self.endheaders()
  File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 236, in connect
    self.sock = self._new_conn()
  File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 211, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f45c23beb00>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.10/dist-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=9001): Max retries exceeded with url: /parse_website/parse?url=https://toso.dev/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f45c23beb00>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/omniparse/demo.py", line 381, in parse_website
    post_response = requests.post(post_url, headers={"accept": "application/json"})
  File "/usr/local/lib/python3.10/dist-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=9001): Max retries exceeded with url: /parse_website/parse?url=https://toso.dev/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f45c23beb00>: Failed to establish a new connection: [Errno 111] Connection refused'))

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 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
  File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 859, 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 "/app/omniparse/demo.py", line 406, in parse_website
    raise gr.Error(f"HTTP error occurred: {e}")
gradio.exceptions.Error: "HTTP error occurred: HTTPConnectionPool(host='localhost', port=9001): Max retries exceeded with url: /parse_website/parse?url=https://toso.dev/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f45c23beb00>: Failed to establish a new connection: [Errno 111] Connection refused'))"

Please advice.