Download patch_mount.py from Leon4gr45/agent-0: direct link, hf CLI and curl.
- Browser
- Download file 768 Bytes
-
https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/patch_mount.py
- Command line
-
hf download hf://spaces/Leon4gr45/agent-0/patch_mount.py
-
curl -L -o patch_mount.py https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/patch_mount.py
768 Bytes
| # If app.mount is at line 197, why does it return 404? | |
| # Notice what happened earlier. I ran it locally, and `http://127.0.0.1:7860/ocr/ready` returned 503 instead of 404! | |
| # Wait, locally I ran `uvicorn api:app`. On HF Space, the Dockerfile has `CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]` | |
| # Are they identical? | |
| # YES. So why is HF space returning 404? | |
| # The HTTP logs inside my bash curl trace for HF Space: | |
| # `< x-proxied-path: /ocr/ready` | |
| # Wait, HF Space forwards the path unmodified! | |
| # But wait, look closely at the `curl` output: | |
| # `{"detail":"Not Found"}` | |
| # This is a VERY specific error. | |
| # Is my `app.mount("/ocr", ocr_app)` actually catching it? | |
| # In FastAPI, mounted applications MIGHT require a trailing slash, or behave differently. | |