Spaces:
Runtime error
Runtime error
Altamira Builder commited on
Commit ·
14dfca6
1
Parent(s): 2ac0a40
fix: revert to Gradio 4.x SDK (working version)
Browse files- Dockerfile +0 -12
- README.md +4 -1
- app.py +1 -13
- requirements.txt +1 -1
Dockerfile
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
FROM python:3.12-slim
|
| 2 |
-
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
COPY requirements.txt .
|
| 6 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
-
|
| 8 |
-
COPY . .
|
| 9 |
-
|
| 10 |
-
EXPOSE 7860
|
| 11 |
-
|
| 12 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -3,6 +3,9 @@ title: Altamira Orchestrator
|
|
| 3 |
emoji: 🧠
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
| 6 |
-
sdk:
|
|
|
|
|
|
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
|
|
|
| 3 |
emoji: 🧠
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: "4.44.1"
|
| 8 |
+
python_version: "3.12"
|
| 9 |
+
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
app.py
CHANGED
|
@@ -4,12 +4,9 @@ from pathlib import Path
|
|
| 4 |
|
| 5 |
import gradio as gr
|
| 6 |
from cryptography.fernet import Fernet
|
| 7 |
-
from fastapi import FastAPI
|
| 8 |
-
from fastapi.responses import JSONResponse
|
| 9 |
from huggingface_hub import HfApi
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
STATE_DATASET = "altamira-state-store"
|
| 14 |
DEFAULT_SANDBOX = "altamira-default-sandbox"
|
| 15 |
STATE_DIR = Path("/tmp/altamira-state")
|
|
@@ -101,12 +98,3 @@ with gr.Blocks(title="Altamira Orchestrator") as demo:
|
|
| 101 |
gh_status = gr.Textbox(label="Status")
|
| 102 |
save_gh = gr.Button("Save GitHub Token")
|
| 103 |
save_gh.click(fn=handle_gh_token, inputs=[gh_token_field, gh_user_field], outputs=gh_status)
|
| 104 |
-
|
| 105 |
-
fastapi_app = FastAPI()
|
| 106 |
-
|
| 107 |
-
@fastapi_app.get("/health")
|
| 108 |
-
async def health():
|
| 109 |
-
return JSONResponse({"status": "ok"})
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
app = gr.mount_gradio_app(fastapi_app, demo, path="/")
|
|
|
|
| 4 |
|
| 5 |
import gradio as gr
|
| 6 |
from cryptography.fernet import Fernet
|
|
|
|
|
|
|
| 7 |
from huggingface_hub import HfApi
|
| 8 |
|
| 9 |
+
API = HfApi()
|
|
|
|
| 10 |
STATE_DATASET = "altamira-state-store"
|
| 11 |
DEFAULT_SANDBOX = "altamira-default-sandbox"
|
| 12 |
STATE_DIR = Path("/tmp/altamira-state")
|
|
|
|
| 98 |
gh_status = gr.Textbox(label="Status")
|
| 99 |
save_gh = gr.Button("Save GitHub Token")
|
| 100 |
save_gh.click(fn=handle_gh_token, inputs=[gh_token_field, gh_user_field], outputs=gh_status)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
gradio>=5.0.0
|
| 2 |
fastapi>=0.104.0
|
| 3 |
uvicorn[standard]>=0.24.0
|
| 4 |
cryptography>=41.0.0
|
|
|
|
| 1 |
+
gradio>=4.0.0,<5.0.0
|
| 2 |
fastapi>=0.104.0
|
| 3 |
uvicorn[standard]>=0.24.0
|
| 4 |
cryptography>=41.0.0
|