Spaces:
Build error
Build error
Commit ·
db4417d
1
Parent(s): af9e59f
Removed gradio
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from fastapi import FastAPI, Request, HTTPException
|
| 2 |
from fastapi.responses import JSONResponse
|
| 3 |
import requests
|
| 4 |
-
import
|
| 5 |
import os
|
| 6 |
|
| 7 |
app = FastAPI()
|
|
@@ -79,11 +79,5 @@ def send_whatsapp_message(recipient_id: str, message_text: str):
|
|
| 79 |
if response.status_code != 200:
|
| 80 |
print(f"Failed to send message: {response.status_code} - {response.text}")
|
| 81 |
|
| 82 |
-
# Gradio interface to keep the Space running
|
| 83 |
-
def dummy_interface():
|
| 84 |
-
return "FastAPI application is running."
|
| 85 |
-
|
| 86 |
-
iface = gr.Interface(fn=dummy_interface, inputs=[], outputs="text")
|
| 87 |
-
|
| 88 |
if __name__ == "__main__":
|
| 89 |
-
|
|
|
|
| 1 |
from fastapi import FastAPI, Request, HTTPException
|
| 2 |
from fastapi.responses import JSONResponse
|
| 3 |
import requests
|
| 4 |
+
import uvicorn
|
| 5 |
import os
|
| 6 |
|
| 7 |
app = FastAPI()
|
|
|
|
| 79 |
if response.status_code != 200:
|
| 80 |
print(f"Failed to send message: {response.status_code} - {response.text}")
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
if __name__ == "__main__":
|
| 83 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|