Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,13 @@ import gradio as gr
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
@spaces.GPU
|
| 7 |
def respond(
|
| 8 |
message,
|
|
@@ -68,4 +75,8 @@ with gr.Blocks() as demo:
|
|
| 68 |
|
| 69 |
|
| 70 |
if __name__ == "__main__":
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
|
| 6 |
+
app = FastAPI()
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
@app.get("/")
|
| 10 |
+
def read_main():
|
| 11 |
+
return {"message": "This is your main app"}
|
| 12 |
+
|
| 13 |
@spaces.GPU
|
| 14 |
def respond(
|
| 15 |
message,
|
|
|
|
| 75 |
|
| 76 |
|
| 77 |
if __name__ == "__main__":
|
| 78 |
+
import uvicorn
|
| 79 |
+
uvicorn.run(outer_app, host="0.0.0.0", port=8000)
|
| 80 |
+
|
| 81 |
+
# if __name__ == "__main__":
|
| 82 |
+
# demo.launch()
|