Spaces:
Sleeping
Sleeping
File size: 469 Bytes
9156e05 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
def main():
import uvicorn
# Important: OpenEnv validation requires starting the uvicorn hook through main() block
uvicorn.run(
"app:app",
host="0.0.0.0",
port=int(os.getenv("PORT", 7860)),
reload=False,
log_level="info",
)
if __name__ == "__main__":
main()
|