Skip to content

Commit 222bd57

Browse files
authored
update torchcodec in ci (#7764)
* update torchcodec in ci * ffmpeg for windows ci * fix tests
1 parent 97daa9a commit 222bd57

File tree

3 files changed

+37
-7
lines changed

3 files changed

+37
-7
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ jobs:
5353
uses: actions/setup-python@v5
5454
with:
5555
python-version: "3.9"
56+
- name: Setup conda env (windows)
57+
if: ${{ matrix.os == 'windows-latest' }}
58+
uses: conda-incubator/setup-miniconda@v2
59+
with:
60+
auto-update-conda: true
61+
miniconda-version: "latest"
62+
activate-environment: test
63+
python-version: "3.9"
64+
- name: Setup FFmpeg (windows)
65+
if: ${{ matrix.os == 'windows-latest' }}
66+
run: conda install "ffmpeg=7.0.1" -c conda-forge
5667
- name: Upgrade pip
5768
run: python -m pip install --upgrade pip
5869
- name: Install uv
@@ -86,11 +97,22 @@ jobs:
8697
if: ${{ matrix.os == 'ubuntu-latest' }}
8798
run: |
8899
sudo apt update
89-
sudo apt install -y ffmpeg
100+
sudo apt install -y ffmpeg
90101
- name: Set up Python 3.11
91102
uses: actions/setup-python@v5
92103
with:
93104
python-version: "3.11"
105+
- name: Setup conda env (windows)
106+
if: ${{ matrix.os == 'windows-latest' }}
107+
uses: conda-incubator/setup-miniconda@v2
108+
with:
109+
auto-update-conda: true
110+
miniconda-version: "latest"
111+
activate-environment: test
112+
python-version: "3.11"
113+
- name: Setup FFmpeg (windows)
114+
if: ${{ matrix.os == 'windows-latest' }}
115+
run: conda install "ffmpeg=7.0.1" -c conda-forge
94116
- name: Upgrade pip
95117
run: python -m pip install --upgrade pip
96118
- name: Install uv
@@ -123,6 +145,17 @@ jobs:
123145
uses: actions/setup-python@v5
124146
with:
125147
python-version: "3.11"
148+
- name: Setup conda env (windows)
149+
if: ${{ matrix.os == 'windows-latest' }}
150+
uses: conda-incubator/setup-miniconda@v2
151+
with:
152+
auto-update-conda: true
153+
miniconda-version: "latest"
154+
activate-environment: test
155+
python-version: "3.11"
156+
- name: Setup FFmpeg (windows)
157+
if: ${{ matrix.os == 'windows-latest' }}
158+
run: conda install "ffmpeg=7.0.1" -c conda-forge
126159
- name: Upgrade pip
127160
run: python -m pip install --upgrade pip
128161
- name: Install uv

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"multiprocess<0.70.17", # to align with dill<0.3.9 (see above)
127127
# to save datasets locally or on any filesystem
128128
# minimum 2023.1.0 to support protocol=kwargs in fsspec's `open`, `get_fs_token_paths`, etc.: see https://github.com/fsspec/filesystem_spec/pull/1143
129-
"fsspec[http]>=2023.1.0,<=2025.7.0",
129+
"fsspec[http]>=2023.1.0,<=2025.9.0",
130130
# To get datasets from the Datasets Hub on huggingface.co
131131
"huggingface-hub>=0.24.0",
132132
# Utilities from PyPA to e.g., compare versions
@@ -184,7 +184,7 @@
184184
"zstandard",
185185
"polars[timezone]>=0.20.0",
186186
"Pillow>=9.4.0", # When PIL.Image.ExifTags was introduced
187-
"torchcodec>=0.6.0; sys_platform != 'win32'", # not available for windows
187+
"torchcodec>=0.7.0", # minium version to get windows support
188188
]
189189

190190
NUMPY2_INCOMPATIBLE_LIBRARIES = [

src/datasets/arrow_dataset.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,9 +1549,6 @@ def save_to_disk(
15491549
num_shards = int(dataset_nbytes / max_shard_size) + 1
15501550
num_shards = max(num_shards, num_proc or 1)
15511551

1552-
num_proc = num_proc if num_proc is not None else 1
1553-
num_shards = num_shards if num_shards is not None else num_proc
1554-
15551552
fs: fsspec.AbstractFileSystem
15561553
fs, _ = url_to_fs(dataset_path, **(storage_options or {}))
15571554

@@ -1609,7 +1606,7 @@ def save_to_disk(
16091606
)
16101607
shard_lengths = [None] * num_shards
16111608
shard_sizes = [None] * num_shards
1612-
if num_proc >= 1:
1609+
if num_proc is not None and num_proc >= 1:
16131610
with Pool(num_proc) as pool:
16141611
with pbar:
16151612
for job_id, done, content in iflatmap_unordered(

0 commit comments

Comments
 (0)