Skip to content

Commit

Permalink
ci: add torchaudio dep
Browse files Browse the repository at this point in the history
  • Loading branch information
LutingWang committed Dec 15, 2024
1 parent 6e56158 commit 19fd833
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
- python: "3.11"
torch: "2.2.2"
torchvision: "0.17.2"
torchaudio: "2.2.2"
steps:
- uses: LutingWang/todd/.github/actions/checkout-todd@main
- uses: actions/setup-python@master
Expand All @@ -19,7 +20,7 @@ jobs:
- name: Lint
run: |
pip install -U setuptools wheel
pip install torch==${{ matrix.torch }} torchvision==${{ matrix.torchvision }}
pip install torch==${{ matrix.torch }} torchvision==${{ matrix.torchvision }} torchaudio==${{ matrix.torchaudio }}
pip install git+https://github.com/lvis-dataset/lvis-api.git@lvis_challenge_2021 --no-build-isolation
pip install .[optional,lint,doc,test]
mim install mmcv
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
- python: "3.11"
torch: "2.2.2"
torchvision: "0.17.2"
torchaudio: "2.2.2"
steps:
- uses: LutingWang/todd/.github/actions/checkout-todd@main
with:
Expand All @@ -24,7 +25,7 @@ jobs:
- name: Test
run: |
pip install -U setuptools wheel
pip install torch==${{ matrix.torch }} torchvision==${{ matrix.torchvision }}
pip install torch==${{ matrix.torch }} torchvision==${{ matrix.torchvision }} torchaudio==${{ matrix.torchaudio }}
pip install git+https://github.com/lvis-dataset/lvis-api.git@lvis_challenge_2021 --no-build-isolation
pip install .[optional,test]
mim install mmcv
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ repos:
- id: mypy
exclude: docs
additional_dependencies:
- numpy
- numpy<2.0
- pandas-stubs
- types-Pillow
- types-requests
Expand Down
4 changes: 1 addition & 3 deletions todd/tasks/natural_language_processing/bpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
from todd.loggers import logger
from todd.utils import ArgsKwargs, SerializeMixin

Token = int
TokenPair = tuple[Token, Token]
TokenSequence = list[Token]
from .tokenizers import Token, TokenPair, TokenSequence

T = TypeVar('T', bound=nn.Module)

Expand Down
7 changes: 6 additions & 1 deletion todd/tasks/natural_language_processing/tokenizers/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
__all__ = [
'Token',
'TokenPair',
'TokenSequence',
'BaseTokenizer',
]

Expand All @@ -9,7 +12,9 @@

from todd.patches.py_ import classproperty

from ..bpe import TokenSequence
Token = int
TokenPair = tuple[Token, Token]
TokenSequence = list[Token]


class BaseTokenizer:
Expand Down
4 changes: 2 additions & 2 deletions todd/tasks/natural_language_processing/tokenizers/clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import ftfy
import regex as re

from ..bpe import BPE, TokenSequence
from .base import BaseTokenizer
from ..bpe import BPE
from .base import BaseTokenizer, TokenSequence

UTF_8 = 'utf-8'

Expand Down

0 comments on commit 19fd833

Please sign in to comment.