Spaces:
Sleeping
Sleeping
added the style fix to the js
Browse files
app.py
CHANGED
|
@@ -1,7 +1,17 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def greet(name):
|
| 4 |
-
return "Hello
|
| 5 |
|
|
|
|
| 6 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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)
|