Spaces:
Running on L40S
Running on L40S
root commited on
Commit ·
48d9a6b
1
Parent(s): 6e3d59a
update env
Browse files- Dockerfile +23 -0
- app.py +5 -0
Dockerfile
CHANGED
|
@@ -39,5 +39,28 @@ COPY --chown=user ./requirements.txt requirements.txt
|
|
| 39 |
# `import vllm` at container start.
|
| 40 |
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
COPY --chown=user . /app
|
| 43 |
CMD ["python3", "app.py"]
|
|
|
|
| 39 |
# `import vllm` at container start.
|
| 40 |
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
| 41 |
|
| 42 |
+
# Force-upgrade gradio specifically.
|
| 43 |
+
#
|
| 44 |
+
# The vllm/vllm-openai:v0.8.5 base image ships an old gradio (pre-4.4) that
|
| 45 |
+
# is missing newer kwargs like `show_copy_button` on gr.Textbox. Listing
|
| 46 |
+
# `gradio>=4.44` in requirements.txt is NOT enough: without --upgrade, pip
|
| 47 |
+
# leaves any already-installed gradio in place as long as it parses as
|
| 48 |
+
# >=4.44 (and even when it doesn't, the resolver sometimes keeps it for
|
| 49 |
+
# compatibility reasons inside this image).
|
| 50 |
+
#
|
| 51 |
+
# We isolate this to a single line and use:
|
| 52 |
+
# --upgrade : actually replace the existing gradio
|
| 53 |
+
# --upgrade-strategy only-if-needed
|
| 54 |
+
# : do NOT cascade-upgrade gradio's deps
|
| 55 |
+
# (fastapi / pydantic / starlette /
|
| 56 |
+
# uvicorn) unless gradio strictly
|
| 57 |
+
# requires it -- those are tightly
|
| 58 |
+
# coupled to vllm's OpenAI server and
|
| 59 |
+
# bumping them can break `import vllm`.
|
| 60 |
+
# --prefer-binary : never trigger a source build.
|
| 61 |
+
RUN pip install --no-cache-dir --prefer-binary \
|
| 62 |
+
--upgrade --upgrade-strategy only-if-needed \
|
| 63 |
+
"gradio>=4.44,<6"
|
| 64 |
+
|
| 65 |
COPY --chown=user . /app
|
| 66 |
CMD ["python3", "app.py"]
|
app.py
CHANGED
|
@@ -243,6 +243,11 @@ with gr.Blocks(title="SongPrep Demo Space") as demo:
|
|
| 243 |
label="Parsed Lyrics",
|
| 244 |
value="*(Results will appear here.)*",
|
| 245 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
raw_output = gr.Textbox(
|
| 247 |
label="Raw Output",
|
| 248 |
lines=4,
|
|
|
|
| 243 |
label="Parsed Lyrics",
|
| 244 |
value="*(Results will appear here.)*",
|
| 245 |
)
|
| 246 |
+
# `show_copy_button` was added in Gradio 4.4. The
|
| 247 |
+
# vllm/vllm-openai:v0.8.5 base image ships an older gradio,
|
| 248 |
+
# so the Dockerfile force-upgrades gradio to >=4.44 right
|
| 249 |
+
# after `pip install -r requirements.txt`. With that upgrade
|
| 250 |
+
# in place this kwarg is safe to use.
|
| 251 |
raw_output = gr.Textbox(
|
| 252 |
label="Raw Output",
|
| 253 |
lines=4,
|