Spaces:
Running on Zero
Running on Zero
File size: 675 Bytes
749bffa | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | """Operator console package.
WHY THIS FILE EXISTS, given that namespace packages usually make it optional.
HuggingFace Spaces launches the app as a script (`python app/app.py`), which
places `app/` itself on `sys.path`. Without an `__init__.py`, `app` at the
repository root is only a NAMESPACE package, and Python resolves a regular
module found later on the path -- `app/app.py` -- in preference to it. `import
app` then binds to the module that is still executing, and `from app import
panels` fails with a circular import.
Making this a regular package means the repository-root `app` wins immediately,
so script launch and `python -m app.app` resolve identically.
"""
|