From f905aa22cc1f1641612c20ea1821b49f6672d241 Mon Sep 17 00:00:00 2001 From: starrrLight Date: Thu, 15 Oct 2026 15:47:19 +0800 Subject: [PATCH] =?UTF-8?q?chore(=E4=BE=9D=E8=B5=96):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=BE=9D=E8=B5=96=E5=AE=89=E8=A3=85=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 torch 与 transformers 纳入默认运行依赖,并让 Docker 镜像安装完整项目依赖。 --- Dockerfile | 2 +- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6df9d27..cae4b34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ COPY middleware ./middleware RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple \ --trusted-host pypi.tuna.tsinghua.edu.cn \ --default-timeout=60 --no-cache-dir \ - ".[guard]" + . COPY config.yaml ./ COPY plugins ./plugins ENV HF_HUB_OFFLINE=1 diff --git a/pyproject.toml b/pyproject.toml index bdee978..a3150ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,11 +13,12 @@ dependencies = [ "PyYAML==6.0.3", "lupa==2.8", "uvicorn>=0.35,<1", + "torch>=2.2", + "transformers>=4.51,<5" ] [project.optional-dependencies] dev = ["pytest>=8,<10", "pytest-asyncio>=1,<2", "httpx>=0.28,<1", "ruff>=0.14,<1"] -guard = ["torch>=2.2", "transformers>=4.51,<5"] [project.scripts] agent-safe-middleware = "middleware.cli:main"