Spaces:
Sleeping
Sleeping
Noperi commited on
Commit ·
20df4b2
1
Parent(s): a6ca4f5
Switch back to standard Gradio SDK
Browse files- Dockerfile +0 -5
- README.md +2 -2
- app.py +4 -20
Dockerfile
DELETED
|
@@ -1,5 +0,0 @@
|
|
| 1 |
-
FROM python:3.10-slim
|
| 2 |
-
WORKDIR /code
|
| 3 |
-
RUN pip install --no-cache-dir fastapi uvicorn requests telethon pyaes rsa huggingface_hub<0.24.0
|
| 4 |
-
COPY ./app.py /code/app.py
|
| 5 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -3,7 +3,7 @@ title: GitCloud Bridge
|
|
| 3 |
emoji: 🚀
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
pinned: false
|
| 9 |
---
|
|
|
|
| 3 |
emoji: 🚀
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 4.19.0
|
| 8 |
pinned: false
|
| 9 |
---
|
app.py
CHANGED
|
@@ -1,23 +1,7 @@
|
|
| 1 |
-
import
|
| 2 |
-
from fastapi import FastAPI, HTTPException
|
| 3 |
-
import uvicorn
|
| 4 |
|
| 5 |
-
app = FastAPI()
|
| 6 |
-
|
| 7 |
-
@app.get("/")
|
| 8 |
-
def root():
|
| 9 |
-
return {"status": "GitCloud Bridge Active", "telethon": "connected"}
|
| 10 |
-
|
| 11 |
-
@app.get("/health")
|
| 12 |
def health():
|
| 13 |
-
return
|
| 14 |
-
|
| 15 |
-
@app.get("/download_tg")
|
| 16 |
-
async def download_telegram_file(file_id: str, bot_token: str, chat_id: str = None):
|
| 17 |
-
try:
|
| 18 |
-
return {"status": "success", "file_id": file_id, "message": "Bridge ready"}
|
| 19 |
-
except Exception as e:
|
| 20 |
-
raise HTTPException(status_code=500, detail=str(e))
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
|
|
|
| 1 |
+
import gradio as gr
|
|
|
|
|
|
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
def health():
|
| 4 |
+
return "GitCloud Bridge Active"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
demo = gr.Interface(fn=health, inputs=[], outputs="text")
|
| 7 |
+
demo.launch()
|