JackRabbit commited on
Commit
e4caeae
·
1 Parent(s): c442c56

new fastapi app

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -240,3 +240,9 @@ async def predict_endpoint(
240
  # (On Hugging Face Spaces, a separate command may be used.)
241
  # if __name__ == "__main__":
242
  # uvicorn.run(app, host="0.0.0.0", port=7860)
 
 
 
 
 
 
 
240
  # (On Hugging Face Spaces, a separate command may be used.)
241
  # if __name__ == "__main__":
242
  # uvicorn.run(app, host="0.0.0.0", port=7860)
243
+ if __name__ == "__main__":
244
+ import uvicorn
245
+ import os
246
+
247
+ port = int(os.environ.get("PORT", 7860))
248
+ uvicorn.run(app, host="0.0.0.0", port=port)