Spaces:
Runtime error
Runtime error
Download src/app.py from Shami96/PDF-Data_Extractor: direct link, hf CLI and curl.
- Browser
- Download file 380 Bytes
-
https://huggingface.co/spaces/Shami96/PDF-Data_Extractor/resolve/main/src/app.py
- Command line
-
hf download hf://spaces/Shami96/PDF-Data_Extractor/src/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Shami96/PDF-Data_Extractor/resolve/main/src/app.py
380 Bytes
| from configuration import RESTART_IF_NO_GPU | |
| from drivers.web.fastapi_app import create_app | |
| from drivers.web.dependency_injection import setup_dependencies | |
| import torch | |
| if RESTART_IF_NO_GPU: | |
| if not torch.cuda.is_available(): | |
| raise RuntimeError("No GPU available. Restarting the service is required.") | |
| controllers = setup_dependencies() | |
| app = create_app(controllers) | |