Spaces:
Sleeping
Sleeping
encryptd
Remove torchvision pin to allow vllm 0.12.0 to resolve its own torchvision dependency
a35ce3f Handover Log: NuExtract3 A100 HF Space Deployment
This document maintains a persistent, sequential log of all operations and states related to the deployment of the encryptd/ocr_vlm_nuextract3 Hugging Face Space.
Project Details
- Current Workspace Path:
/Users/mdasad/hf_space_git/ocr_vlm_nuextract3 - Target Space ID:
encryptd/ocr_vlm_nuextract3 - Hardware: A100 GPU (
a100-large) - Underlying Model:
numind/NuExtract3(based on Qwen3.5-4B) - SDK: Custom Docker (Ubuntu 22.04 + CUDA 12.4.1 Devel)
- API URL:
https://huggingface.co/proxy/encryptd-ocr-vlm-nuextract3.hf.space
Sequence of Events
1. Planning & Pre-checks (Completed)
- Verified active environment Hugging Face Token belongs to user
encryptd. - Researched model ID and verified
numind/NuExtract3is the active target. - Created the new Space encryptd/ocr_vlm_nuextract3 on Hugging Face.
2. Transition to Custom Docker Space (Completed)
- Discovered that the default Gradio Space SDK enforces Python 3.13, which has no pre-compiled
vllmwheels. - Converted the Space to a custom Docker Space (
sdk: docker) usingnvidia/cuda:12.4.1-runtime-ubuntu22.04and Python 3.10 to allow native GPU execution and fast wheel installation.
3. Triage of NVIDIA Driver Error (Completed)
- Problem: Upon container startup, the host GPU driver version was reported as
12040(supporting up to CUDA 12.4). PyTorch (initially resolved to the latest2.11.0/ CUDA 12.6/12.8 wheel) crashed withRuntimeError: The NVIDIA driver on your system is too old (found version 12040). - Solution: Modified
requirements.txtto explicitly use the official PyTorch CUDA 12.4 wheel repository (https://download.pytorch.org/whl/cu124) and pinned:torch==2.5.1(ortorch==2.5.1+cu124depending on system resolution)vllm==0.7.2This resolved the driver version conflict successfully due to CUDA's backward compatibility.
4. Triage of Tokenizer and Multimodal ValueError (Completed)
- Tokenizer Problem: The newer
transformers>=5.xpackage has deprecated/removed the tokenizer attributeall_special_tokens_extended. Sourcing an older version of vLLM (likev0.8.0or below) withtransformers>=5.xcaused theAttributeError: TokenizersBackend has no attribute all_special_tokens_extendedcrash. - Multimodal ValueError / KeyError 'qwen3_5': Older vLLM/Transformers versions either throw
ValueError: limit_mm_per_prompt is only supported for multimodal models(due to missing remote-code registration) orKeyError: 'qwen3_5'(due to theqwen3_5architecture being unrecognized in oldertransformerslibraries). - Unified Resolution:
- Upgraded to
vllm==0.12.0andtorch==2.6.0+cu124. - Sourced the CUDA 12.4 index (
cu124) to guarantee driver compatibility with12040on HF Spaces. - Sourced
vllm==0.12.0which natively targetstransformers>=5.xand supports theqwen3_5architecture without tokenizer or registration issues. - Restored all high-performance model card recommended arguments:
--limit-mm-per-prompt '{"image": 99, "video": 0}'(allows multi-page document processing up to 99 pages/images).--chat-template-content-format openaiand--generation-config vllm(properly registers the Qwen 3.5 architecture).--speculative-config '{"method": "qwen3_next_mtp", "num_speculative_tokens": 2}'(enables multi-token speculative decoding).--enforce-eager.
- Upgraded to
5. First Push & Build (Completed)
- Configured Hugging Face login authentication on the local CLI, storing Git credentials in the
osxkeychainhelper, and cleaned the git remote URL to remove the embedded token, strictly referencing it via environment credentials. - Pushed the finalized configuration.
6. Resolution of the NVIDIA Driver 12040 Mismatch (Completed)
- Problem: When
pipinstalled the standardtorchpackage, it fell back to PyPI's default CUDA 13.0/12.8 wheel because thehttps://download.pytorch.org/whl/cu124index contains2.6.0+cu124(requiring the exact version suffix match to prevent PyPI fallback). This mismatch crashed the container runtime on the Space's A100 GPU host (which runs NVIDIA driver12040supporting up to CUDA 12.4). - Resolution:
- Updated
requirements.txtto explicitly requesttorch==2.6.0+cu124. - Added a direct pre-installation layer in the
Dockerfiletargeting--index-url https://download.pytorch.org/whl/cu124to absolutely guarantee that PyTorch installs the CUDA 12.4 pre-compiled wheel. - This guarantees PyTorch matches the host's driver version (
12040) perfectly while allowing the modernvllm==0.12.0runtime to execute natively on the A100 hardware, dynamically pulling its compatibletorchvisionversion automatically.
- Updated
Current Status
- Hugging Face Status:
stage: RUNNING - The FastAPI API proxy is live and bound to the Gradio web interface at the root.
- The vLLM engine is fully operational with complete multi-page document image processing and multi-token speculative decoding enabled.