Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,30 @@ jobs:
run: |
python -m pip list --format=columns

- name: Cache Qwen tokenizer vocab
uses: actions/cache@v4
with:
path: ~/.cache/dashscope/tokenizers
key: qwen-tokenizer-vocab-v1

# ModelScope downloads from GitHub runners time out intermittently;
# pre-fetch with retries so network blips don't fail the test matrix.
- name: Pre-download Qwen tokenizer vocab
run: |
python - <<'EOF'
import time
from dashscope.legacy_1x.tokenizers import tokenizer as t
for attempt in range(1, 6):
try:
print("vocab ready:", t._resolve_vocab_path())
break
except RuntimeError as exc:
print(f"attempt {attempt}/5 failed: {exc}")
if attempt == 5:
raise SystemExit(1)
time.sleep(5 * attempt)
EOF

- name: Run current tests with coverage
run: |
coverage run -m pytest tests --ignore=tests/legacy_1x
Expand Down Expand Up @@ -113,6 +137,30 @@ jobs:
pip install -r requirements.txt
pip install -r requirements-test.txt

- name: Cache Qwen tokenizer vocab
uses: actions/cache@v4
with:
path: ~/.cache/dashscope/tokenizers
key: qwen-tokenizer-vocab-v1

# ModelScope downloads from GitHub runners time out intermittently;
# pre-fetch with retries so network blips don't fail the test matrix.
- name: Pre-download Qwen tokenizer vocab
run: |
python - <<'EOF'
import time
from dashscope.legacy_1x.tokenizers import tokenizer as t
for attempt in range(1, 6):
try:
print("vocab ready:", t._resolve_vocab_path())
break
except RuntimeError as exc:
print(f"attempt {attempt}/5 failed: {exc}")
if attempt == 5:
raise SystemExit(1)
time.sleep(5 * attempt)
EOF

- name: Run archived legacy tests
run: |
python -m pytest tests/legacy_1x
Loading