iceberg0142 commited on
Commit
00d0e30
·
1 Parent(s): 55f23e4
Files changed (3) hide show
  1. __pycache__/app.cpython-311.pyc +0 -0
  2. app.py +3 -13
  3. main.py +14 -0
__pycache__/app.cpython-311.pyc ADDED
Binary file (806 Bytes). View file
 
app.py CHANGED
@@ -1,14 +1,4 @@
1
- from fastapi import FastAPI
2
- import gradio as gr
3
 
4
- app = FastAPI()
5
-
6
- @app.get("/")
7
- def read_main():
8
- return {"message": "This is your main app"}
9
-
10
- io = gr.Interface(lambda x: "Hello, " + x + "!", "textbox", "textbox")
11
- app = gr.mount_gradio_app(app, io, path="/gradio")
12
-
13
- # # Launch the app (which will be hosted on Hugging Face Spaces)
14
- # io.launch()
 
1
+ import uvicorn
 
2
 
3
+ if __name__ == "__main__":
4
+ uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)
 
 
 
 
 
 
 
 
 
main.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ import gradio as gr
3
+
4
+ app = FastAPI()
5
+
6
+ @app.get("/")
7
+ def read_main():
8
+ return {"message": "This is your main app"}
9
+
10
+ io = gr.Interface(lambda x: "Hello, " + x + "!", "textbox", "textbox")
11
+ app = gr.mount_gradio_app(app, io, path="/gradio")
12
+
13
+ # # Launch the app (which will be hosted on Hugging Face Spaces)
14
+ # io.launch()