Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,21 +6,16 @@ import uvicorn
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
-
def predict(a):
|
| 10 |
-
return a
|
| 11 |
|
| 12 |
block = gr.Blocks().queue()
|
| 13 |
with block:
|
| 14 |
prompt = gr.Text()
|
| 15 |
output = gr.Text()
|
| 16 |
-
|
| 17 |
btn = gr.Button("Generate")
|
| 18 |
-
btn.click(
|
| 19 |
|
| 20 |
-
gradio_app = gr.routes.App.create_app(block)
|
| 21 |
|
| 22 |
-
app = gr.mount_gradio_app(app,
|
| 23 |
-
gradio_api_url="http://localhost:7860/")
|
| 24 |
app.mount("/static", StaticFiles(directory="static", html=True), name="static")
|
| 25 |
-
|
| 26 |
-
uvicorn.run(app, host='0.0.0.0', port=7860)
|
|
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
|
|
|
|
|
|
| 9 |
|
| 10 |
block = gr.Blocks().queue()
|
| 11 |
with block:
|
| 12 |
prompt = gr.Text()
|
| 13 |
output = gr.Text()
|
| 14 |
+
|
| 15 |
btn = gr.Button("Generate")
|
| 16 |
+
btn.click(lambda x:x, inputs=[prompt], outputs=[output])
|
| 17 |
|
|
|
|
| 18 |
|
| 19 |
+
app = gr.mount_gradio_app(app, block, "/", gradio_api_url="http://localhost:7860/")
|
|
|
|
| 20 |
app.mount("/static", StaticFiles(directory="static", html=True), name="static")
|
| 21 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|