takamarou commited on
Commit
eca8cbc
·
1 Parent(s): ef8cba2

finally a working fastapi server

Browse files
Files changed (2) hide show
  1. app.py +8 -2
  2. modules/app.py +0 -1
app.py CHANGED
@@ -1,3 +1,9 @@
1
- import subprocess
2
 
3
- subprocess.run("uvicorn modules.app:app --host 0.0.0.0 --port 7860", shell=True)
 
 
 
 
 
 
 
1
+ #import subprocess
2
 
3
+ #subprocess.run("uvicorn modules.app:app --host 0.0.0.0 --port 7860", shell=True)
4
+
5
+ import uvicorn
6
+
7
+ if __name__ == "__main__":
8
+ print('starting')
9
+ uvicorn.run("modules.app:app", port=7860, host='0.0.0.0', log_level="debug")
modules/app.py CHANGED
@@ -21,7 +21,6 @@ pipeline.to("cuda")
21
 
22
  @app.get("/")
23
  def index():
24
- print('here')
25
  return "Hello"
26
 
27
  @spaces.GPU
 
21
 
22
  @app.get("/")
23
  def index():
 
24
  return "Hello"
25
 
26
  @spaces.GPU