Repository navigation
WinError 10054: An existing connection was forcibly closed by the remote host #4203
Replies: 2 comments 1 reply
|
Hi @Sohamactive, Yes, Docling supports pre-downloading its model artifacts and using them locally during conversion. From your project environment, run: uv run docling-tools models download --output-dir .\docling-modelsThen point the PDF pipeline to that directory: from pathlib import Path
from docling.datamodel.base_models import InputFormat
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling.document_converter import DocumentConverter, PdfFormatOption
models_dir = Path(r"C:\path\to\docling-models")
options = PdfPipelineOptions(artifacts_path=models_dir)
converter = DocumentConverter(
format_options={
InputFormat.PDF: PdfFormatOption(pipeline_options=options)
}
)
result = converter.convert("document.pdf")Alternatively, leave $env:DOCLING_ARTIFACTS_PATH = "C:\path\to\docling-models"
uv run python main.pyI tested both approaches on Windows with Python 3.13 and Docling 2.126.0. A PDF containing a table converted successfully with The initial model download still requires a working connection. If Xet is involved in the connection resets, you can try disabling it before downloading: $env:[HF_HUB_DISABLE_XET](https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables#hfhubdisablexet) = "1"
uv run docling-tools models download --output-dir .\docling-models
If the download still fails, another option is to download the artifacts from a different machine or network using the same Docling version, then copy the complete Docling documents the available options here: [Model prefetching and offline usage](https://docling-project.github.io/docling/usage/advanced_options/#model-prefetching-and-offline-usage). |
|
The pre-download route above answers half of this. The other half — "configure Docling for unreliable Hugging Face connections on Windows" — has a specific cause worth knowing, because the usual advice for it is now wrong. Why it dies mid-transfer rather than at connect
Turn Xet off first$env:HF_HUB_DISABLE_XET = "1"
uv run main.pyThat falls back to ordinary HTTPS through HF_HUB_DISABLE_XET: bool = _is_true(os.environ.get("HF_HUB_DISABLE_XET"))If it gets further but still times out, the two relevant timeouts both default to 10 seconds, which is tight on a slow link: $env:HF_HUB_DOWNLOAD_TIMEOUT = "60"
$env:HF_HUB_ETAG_TIMEOUT = "30"Do not reach for
|
Uh oh!
There was an error while loading. Please reload this page.
Hi, I am trying to run Docling locally on Windows using a virtual environment and
uv.My basic setup appears to be working correctly:
However, when Docling tries to download additional models from Hugging Face, the connection repeatedly fails.
The main errors are:
and sometimes:
The failures occur while downloading files from repositories such as:
For example, the failing files include TableFormer model artifacts.
Docling retries the requests, but eventually exits with a Hugging Face Hub download error.
I am currently running:
My question is: is there a recommended way to pre-download the required Docling models or configure Docling for unreliable Hugging Face connections on Windows?
Also, are there any known issues with Hugging Face/Xet downloads causing
WinError 10054on Windows?I would appreciate any recommended troubleshooting steps.
All reactions