Spaces:
Running
Running
Commit ·
39c03ce
1
Parent(s): 2883431
Switch to Gradio 5.x — no SSR, no Node.js required
Browse filesGradio 6 SSR build hangs on HF Spaces regardless of config.
Gradio 5 is stable, no SSR, compatible API. Remove all SSR
workarounds. Docker SDK + slim image + Gradio 5.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Dockerfile +2 -4
- app.py +2 -4
Dockerfile
CHANGED
|
@@ -1,14 +1,12 @@
|
|
| 1 |
FROM python:3.12-slim
|
| 2 |
|
| 3 |
-
RUN apt-get update && apt-get install -y git
|
| 4 |
-
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 5 |
-
apt-get install -y nodejs && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
RUN useradd -m -u 1000 user
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
COPY requirements.txt .
|
| 11 |
-
RUN pip install --no-cache-dir -r requirements.txt gradio=
|
| 12 |
|
| 13 |
COPY . .
|
| 14 |
|
|
|
|
| 1 |
FROM python:3.12-slim
|
| 2 |
|
| 3 |
+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
| 4 |
|
| 5 |
RUN useradd -m -u 1000 user
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
COPY requirements.txt .
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt "gradio>=5.12,<6"
|
| 10 |
|
| 11 |
COPY . .
|
| 12 |
|
app.py
CHANGED
|
@@ -5,10 +5,8 @@ Pre-loaded workspace, global daily question limit, themed to match appsimple.io.
|
|
| 5 |
|
| 6 |
from __future__ import annotations
|
| 7 |
|
| 8 |
-
import os
|
| 9 |
-
os.environ["GRADIO_SSR_MODE"] = "false"
|
| 10 |
-
|
| 11 |
import json
|
|
|
|
| 12 |
import re
|
| 13 |
import tempfile
|
| 14 |
import time
|
|
@@ -511,7 +509,7 @@ def build_app() -> gr.Blocks:
|
|
| 511 |
height=None,
|
| 512 |
label="",
|
| 513 |
show_label=False,
|
| 514 |
-
|
| 515 |
elem_id="chat-output",
|
| 516 |
)
|
| 517 |
|
|
|
|
| 5 |
|
| 6 |
from __future__ import annotations
|
| 7 |
|
|
|
|
|
|
|
|
|
|
| 8 |
import json
|
| 9 |
+
import os
|
| 10 |
import re
|
| 11 |
import tempfile
|
| 12 |
import time
|
|
|
|
| 509 |
height=None,
|
| 510 |
label="",
|
| 511 |
show_label=False,
|
| 512 |
+
show_copy_button=False,
|
| 513 |
elem_id="chat-output",
|
| 514 |
)
|
| 515 |
|