petter2025 commited on
Commit
67e6d4b
·
verified ·
1 Parent(s): c98f35f

Update hf_demo.py

Browse files
Files changed (1) hide show
  1. hf_demo.py +14 -1
hf_demo.py CHANGED
@@ -1,4 +1,6 @@
1
  # hf_demo.py – ARF v4 API with Memory
 
 
2
  from fastapi import FastAPI, HTTPException
3
  from fastapi.middleware.cors import CORSMiddleware
4
  import gradio as gr
@@ -114,4 +116,15 @@ iface = gr.Interface(
114
  outputs="text",
115
  title="ARF v4 Demo"
116
  )
117
- app = gr.mount_gradio_app(app, iface, path="/")
 
 
 
 
 
 
 
 
 
 
 
 
1
  # hf_demo.py – ARF v4 API with Memory
2
+ import os
3
+ import uvicorn
4
  from fastapi import FastAPI, HTTPException
5
  from fastapi.middleware.cors import CORSMiddleware
6
  import gradio as gr
 
116
  outputs="text",
117
  title="ARF v4 Demo"
118
  )
119
+ app = gr.mount_gradio_app(app, iface, path="/")
120
+
121
+ # ============== MAIN ENTRY POINT ==============
122
+ if __name__ == "__main__":
123
+ port = int(os.environ.get('PORT', 7860))
124
+ uvicorn.run(
125
+ "hf_demo:app",
126
+ host="0.0.0.0",
127
+ port=port,
128
+ log_level="info",
129
+ reload=False
130
+ )