Skip to content

Commit 2d7e93d

Browse files
committed
修复sglang bug
1 parent 3102511 commit 2d7e93d

File tree

5 files changed

+116
-87
lines changed

5 files changed

+116
-87
lines changed

.github/workflows/docker-image.yml

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,59 @@ on:
77
push:
88
branches:
99
- build_image # 在推送到 build_image 分支时触发构建
10+
- set_latest
1011

1112
jobs:
1213

13-
build:
14-
14+
build_version:
15+
if: github.ref == 'refs/heads/build_image'
1516
runs-on: ubuntu-latest
1617

1718
steps:
18-
# 检出代码
19-
- name: Checkout code
20-
uses: actions/checkout@v3
21-
# 登录 Docker Hub
22-
- name: Log in to Docker Hub
23-
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
24-
# 从 pyproject.toml 中抽取版本信息
25-
- name: Extract version
26-
id: get_version
27-
run: |
28-
# 使用 grep 和 sed 从 pyproject.toml 中提取版本
29-
version=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
30-
echo "VERSION=$version" >> $GITHUB_ENV
19+
# 检出代码
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
# 登录 Docker Hub
23+
- name: Log in to Docker Hub
24+
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
25+
# 从 pyproject.toml 中抽取版本信息
26+
- name: Extract version
27+
id: get_version
28+
run: |
29+
# 使用 grep 和 sed 从 pyproject.toml 中提取版本
30+
version=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
31+
echo "VERSION=$version" >> $GITHUB_ENV
3132
32-
# 构建 Docker 镜像
33-
- name: Build Docker image
34-
run: |
35-
docker build -t ${{ secrets.DOCKER_USERNAME }}/gpt_server:${{ env.VERSION }} .
36-
docker tag ${{ secrets.DOCKER_USERNAME }}/gpt_server:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/gpt_server:latest
37-
# 推送镜像到 Docker Hub
38-
- name: Push Docker image
39-
run: |
40-
docker push ${{ secrets.DOCKER_USERNAME }}/gpt_server:${{ env.VERSION }}
41-
docker push ${{ secrets.DOCKER_USERNAME }}/gpt_server:latest
33+
# 构建 Docker 镜像
34+
- name: Build Docker image
35+
run: |
36+
docker build -t ${{ secrets.DOCKER_USERNAME }}/gpt_server:${{ env.VERSION }} .
37+
# docker tag ${{ secrets.DOCKER_USERNAME }}/gpt_server:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/gpt_server:latest
38+
# 推送镜像到 Docker Hub
39+
- name: Push Docker image
40+
run: |
41+
docker push ${{ secrets.DOCKER_USERNAME }}/gpt_server:${{ env.VERSION }}
42+
# docker push ${{ secrets.DOCKER_USERNAME }}/gpt_server:latest
43+
tag_latest:
44+
if: github.ref == 'refs/heads/set_latest'
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v3
49+
50+
- name: Log in to Docker Hub
51+
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
52+
53+
- name: Extract version
54+
id: get_version
55+
run: |
56+
version=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
57+
echo "VERSION=$version" >> $GITHUB_ENV
58+
59+
- name: Pull and tag latest
60+
run: |
61+
# 拉取已存在的版本镜像
62+
docker pull ${{ secrets.DOCKER_USERNAME }}/gpt_server:${{ env.VERSION }}
63+
# 仅添加latest标签并推送
64+
docker tag ${{ secrets.DOCKER_USERNAME }}/gpt_server:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/gpt_server:latest
65+
docker push ${{ secrets.DOCKER_USERNAME }}/gpt_server:latest

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN apt-get update -y && apt-get install -y build-essential && rm -rf /var/lib/a
66
COPY ./ /gpt_server
77
WORKDIR /gpt_server
88
# RUN uv sync && uv cache clean
9-
ENV UV_HTTP_TIMEOUT=120
9+
ENV UV_HTTP_TIMEOUT=120 CUDA_HOME=/usr/local/cuda-12.2
1010
RUN uv venv --seed && uv sync && uv cache clean && \
1111
echo '[[ -f .venv/bin/activate ]] && source .venv/bin/activate' >> ~/.bashrc
1212
ENV PATH=/gpt_server/.venv/bin:$PATH

pyproject.toml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "gpt_server"
3-
version = "0.5.2"
3+
version = "0.5.3"
44
description = "gpt_server是一个用于生产级部署LLMs或Embedding的开源框架。"
55
readme = "README.md"
66
license = { text = "Apache 2.0" }
@@ -25,7 +25,7 @@ dependencies = [
2525
"modelscope==1.26.0",
2626
"edge-tts>=7.0.0",
2727
"funasr>=1.2.6",
28-
"sglang[all]>=0.4.6.post5",
28+
"sglang[all]>=0.4.8.post1",
2929
"flashinfer-python",
3030
"flashtts>=0.1.7",
3131
"diffusers>=0.33.1",
@@ -36,6 +36,7 @@ default-groups = [] # 默认只安装dependencies中的库
3636
override-dependencies = [
3737
"setuptools==75.2.0",
3838
"torchvision==0.22.1",
39+
"torchaudio==2.7.1",
3940
"torch==2.7.0",
4041
"triton",
4142
"outlines==0.1.11",
@@ -51,14 +52,6 @@ gpt_server = "gpt_server.cli:main"
5152
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
5253
default = true
5354

54-
# 强制要求 flashinfer-python通过官方源安装
55-
[[tool.uv.index]]
56-
name = "flashinfer-python"
57-
url = "https://flashinfer.ai/whl/cu124/torch2.5"
58-
59-
[tool.uv.sources]
60-
flashinfer-python = { index = "flashinfer-python" }
61-
6255
[build-system]
6356
requires = ["setuptools", "wheel"]
6457
build-backend = "setuptools.build_meta"

requirements.txt

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ filelock==3.18.0
234234
# vllm
235235
fire==0.7.0
236236
# via lmdeploy
237-
flashinfer-python==0.2.5+cu124torch2.5
237+
flashinfer-python==0.2.6.post1
238238
# via
239239
# gpt-server (pyproject.toml)
240240
# sglang
@@ -273,7 +273,7 @@ googleapis-common-protos==1.70.0
273273
# opentelemetry-exporter-otlp-proto-http
274274
greenlet==3.2.3
275275
# via sqlalchemy
276-
grpcio==1.73.0
276+
grpcio==1.73.1
277277
# via opentelemetry-exporter-otlp-proto-grpc
278278
h11==0.16.0
279279
# via
@@ -404,23 +404,23 @@ langchain-community==0.3.26
404404
# via
405405
# evalscope
406406
# ragas
407-
langchain-core==0.3.66
407+
langchain-core==0.3.67
408408
# via
409409
# evalscope
410410
# langchain
411411
# langchain-community
412412
# langchain-openai
413413
# langchain-text-splitters
414414
# ragas
415-
langchain-openai==0.3.25
415+
langchain-openai==0.3.27
416416
# via
417417
# evalscope
418418
# ragas
419419
langchain-text-splitters==0.3.8
420420
# via langchain
421421
langdetect==1.0.9
422422
# via evalscope
423-
langsmith==0.4.2
423+
langsmith==0.4.4
424424
# via
425425
# langchain
426426
# langchain-community
@@ -439,7 +439,7 @@ librosa==0.11.0
439439
# via
440440
# flashtts
441441
# funasr
442-
litellm==1.73.1
442+
litellm==1.73.6
443443
# via sglang
444444
llguidance==0.7.30
445445
# via
@@ -455,7 +455,7 @@ lmdeploy==0.9.0
455455
# via gpt-server (pyproject.toml)
456456
loguru==0.7.3
457457
# via gpt-server (pyproject.toml)
458-
lxml==5.4.0
458+
lxml==6.0.0
459459
# via
460460
# blobfile
461461
# sacrebleu
@@ -499,7 +499,7 @@ msgspec==0.19.0
499499
# vllm
500500
mteb==1.38.20
501501
# via evalscope
502-
multidict==6.5.1
502+
multidict==6.6.3
503503
# via
504504
# aiohttp
505505
# yarl
@@ -519,6 +519,7 @@ nh3==0.2.21
519519
# via fschat
520520
ninja==1.11.1.4
521521
# via
522+
# flashinfer-python
522523
# sglang
523524
# vllm
524525
# xgrammar
@@ -545,6 +546,7 @@ numpy==1.26.4
545546
# diffusers
546547
# einx
547548
# evalscope
549+
# flashinfer-python
548550
# fschat
549551
# gguf
550552
# infinity-emb
@@ -651,7 +653,7 @@ openai==1.86.0
651653
# ragas
652654
# sglang
653655
# vllm
654-
openai-whisper==20240930
656+
openai-whisper==20250625
655657
# via flashtts
656658
opencv-python-headless==4.11.0.86
657659
# via
@@ -774,7 +776,7 @@ pooch==1.8.2
774776
# via librosa
775777
portalocker==3.2.0
776778
# via sacrebleu
777-
posthog==5.4.0
779+
posthog==6.0.0
778780
# via infinity-emb
779781
prometheus-client==0.22.1
780782
# via
@@ -953,6 +955,7 @@ requests==2.32.4
953955
# datasets
954956
# diffusers
955957
# evalscope
958+
# flashinfer-python
956959
# fschat
957960
# funasr
958961
# huggingface-hub
@@ -987,7 +990,7 @@ rich==13.9.4
987990
# rich-toolkit
988991
# streamlit
989992
# typer
990-
rich-toolkit==0.14.7
993+
rich-toolkit==0.14.8
991994
# via fastapi-cli
992995
rouge-chinese==1.0.3
993996
# via evalscope
@@ -1026,6 +1029,7 @@ scipy==1.15.3
10261029
# pynndescent
10271030
# scikit-learn
10281031
# sentence-transformers
1032+
# sglang
10291033
# umap-learn
10301034
# vllm
10311035
seaborn==0.13.2
@@ -1052,9 +1056,9 @@ setuptools==75.2.0
10521056
# torch
10531057
# triton
10541058
# vllm
1055-
sgl-kernel==0.1.4
1059+
sgl-kernel==0.1.9
10561060
# via sglang
1057-
sglang==0.4.6.post5
1061+
sglang==0.4.8.post1
10581062
# via gpt-server (pyproject.toml)
10591063
shellingham==1.5.4
10601064
# via typer
@@ -1151,7 +1155,7 @@ tiktoken==0.9.0
11511155
# sglang
11521156
# vllm
11531157
# xgrammar
1154-
timm==1.0.15
1158+
timm==1.0.16
11551159
# via infinity-emb
11561160
tokenizers==0.21.2
11571161
# via
@@ -1193,8 +1197,11 @@ torch-memory-saver==0.0.8
11931197
# via sglang
11941198
torchao==0.9.0
11951199
# via sglang
1196-
torchaudio==2.7.0
1197-
# via vllm
1200+
torchaudio==2.7.1
1201+
# via
1202+
# --override (workspace)
1203+
# sglang
1204+
# vllm
11981205
torchvision==0.22.1
11991206
# via
12001207
# --override (workspace)
@@ -1279,6 +1286,7 @@ typing-extensions==4.14.0
12791286
# opentelemetry-sdk
12801287
# opentelemetry-semantic-conventions
12811288
# outlines
1289+
# posthog
12821290
# pydantic
12831291
# pydantic-core
12841292
# referencing
@@ -1300,7 +1308,7 @@ typing-inspection==0.4.1
13001308
# pydantic-settings
13011309
tzdata==2025.2
13021310
# via pandas
1303-
umap-learn==0.5.7
1311+
umap-learn==0.5.8
13041312
# via funasr
13051313
urllib3==2.5.0
13061314
# via

0 commit comments

Comments
 (0)