pachet commited on
Commit
306f2c8
·
1 Parent(s): fe435e0

added the style fix to the js

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -1,7 +1,17 @@
1
  import gradio as gr
 
 
 
 
2
 
3
  def greet(name):
4
- return "Hello " + name + "!!"
5
 
 
6
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
 
1
  import gradio as gr
2
+ from fastapi import FastAPI
3
+ import uvicorn
4
+
5
+ app = FastAPI()
6
 
7
  def greet(name):
8
+ return f"Hello {name}!"
9
 
10
+ # ✅ Use Interface instead of Blocks
11
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
12
+
13
+ # ✅ Mount Gradio with FastAPI
14
+ app = gr.mount_gradio_app(app, demo, path="/")
15
+
16
+ if __name__ == "__main__":
17
+ uvicorn.run(app, host="0.0.0.0", port=7860)