Skip to content

Commit b9aeb99

Browse files
committed
try again
1 parent 635b5f9 commit b9aeb99

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/deploy-to-hf.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
- name: Export requirements.txt
2929
run: |
3030
uv export --no-hashes --no-dev -o requirements.txt
31+
# 移除本地包引用(-e .),因为 HF Space 构建时会有问题
32+
grep -v "^-e \." requirements.txt > requirements_hf.txt || true
33+
mv requirements_hf.txt requirements.txt
3134
3235
- name: Prepare deployment files
3336
run: |
@@ -37,11 +40,14 @@ jobs:
3740
# 复制必要文件到部署目录
3841
cp examples/app.py /tmp/hf-deploy/app.py
3942
cp requirements.txt /tmp/hf-deploy/
40-
cp pyproject.toml /tmp/hf-deploy/
41-
cp -r src /tmp/hf-deploy/
43+
cp -r src/chapterbar /tmp/hf-deploy/
4244
4345
cp LICENSE /tmp/hf-deploy/ || echo "LICENSE not found, skipping"
4446
47+
# 修改 app.py 以使用正确的导入路径
48+
# 确保 src 目录在 Python 路径中
49+
sed -i '1i import sys\nsys.path.insert(0, "/app/src")' /tmp/hf-deploy/app.py
50+
4551
# 创建带有 HF Space 配置的 README.md
4652
cat > /tmp/hf-deploy/README.md << 'EOF'
4753
---

0 commit comments

Comments
 (0)