Spaces:
Sleeping
Sleeping
Download server/__init__.py from infoclassifier/InfoClassifier: direct link, hf CLI and curl.
- Browser
- Download file 626 Bytes
-
https://huggingface.co/spaces/infoclassifier/InfoClassifier/resolve/main/server/__init__.py
- Command line
-
hf download hf://spaces/infoclassifier/InfoClassifier/server/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/infoclassifier/InfoClassifier/resolve/main/server/__init__.py
626 Bytes
| """ | |
| server/__init__.py | |
| ================== | |
| Makes `server` a package while still exposing the FastAPI `app` | |
| defined in the root-level server.py. | |
| We use importlib to load server.py by absolute path, avoiding the | |
| circular-name clash that would occur with a plain `import server`. | |
| """ | |
| import importlib.util | |
| import os | |
| _root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| _spec = importlib.util.spec_from_file_location( | |
| "_server_root", | |
| os.path.join(_root, "server.py"), | |
| ) | |
| _mod = importlib.util.module_from_spec(_spec) | |
| _spec.loader.exec_module(_mod) | |
| app = _mod.app # re-export for `from server import app` | |