sksstudio commited on
Commit
1be012e
·
1 Parent(s): 59ee418

Add application file twoo65

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -4,6 +4,7 @@ from llama_cpp import Llama
4
  from typing import Optional
5
  import uvicorn
6
  import huggingface_hub
 
7
 
8
  app = FastAPI(
9
  title="OmniVLM API",
@@ -54,4 +55,5 @@ async def health_check():
54
  return {"status": "healthy"}
55
 
56
  if __name__ == "__main__":
57
- uvicorn.run(app, host="0.0.0.0", port=8000)
 
 
4
  from typing import Optional
5
  import uvicorn
6
  import huggingface_hub
7
+ import os
8
 
9
  app = FastAPI(
10
  title="OmniVLM API",
 
55
  return {"status": "healthy"}
56
 
57
  if __name__ == "__main__":
58
+ port = int(os.environ.get("PORT", 7860)) # Hugging Face Spaces uses port 7860 by default
59
+ uvicorn.run(app, host="0.0.0.0", port=port)