Skip to content

Commit 2843b3d

Browse files
sayakpaulDN6
andauthored
Sunset Python 3.8 & get rid of explicit typing exports where possible (#12524)
* drop python 3.8 * remove list, tuple, dict from typing * fold Unions into | * up * fix a bunch and please me. * up * up * up * up * up * up * enforce 3.10.0. * up * up * up * up * up * up * up * up * Update setup.py Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com> * up. * python 3.10. * ifx * up * up * up * up * final * up * fix typing utils. * up * up * up * up * up * up * fix * up * up * up * up * up * up * handle modern types. * up * up * fix ip adapter type checking. * up * up * up * up * up * up * up * revert docstring changes. * keep deleted files deleted. * keep deleted files deleted. --------- Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>
1 parent 76af013 commit 2843b3d

File tree

789 files changed

+17210
-17698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

789 files changed

+17210
-17698
lines changed

.github/workflows/notify_slack_about_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Python
1616
uses: actions/setup-python@v6
1717
with:
18-
python-version: '3.8'
18+
python-version: '3.10'
1919

2020
- name: Notify Slack about the release
2121
env:

.github/workflows/pr_dependency_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Python
2323
uses: actions/setup-python@v6
2424
with:
25-
python-version: "3.8"
25+
python-version: "3.10"
2626
- name: Install dependencies
2727
run: |
2828
pip install -e .

.github/workflows/pr_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Set up Python
3636
uses: actions/setup-python@v6
3737
with:
38-
python-version: "3.8"
38+
python-version: "3.10"
3939
- name: Install dependencies
4040
run: |
4141
pip install --upgrade pip
@@ -55,7 +55,7 @@ jobs:
5555
- name: Set up Python
5656
uses: actions/setup-python@v6
5757
with:
58-
python-version: "3.8"
58+
python-version: "3.10"
5959
- name: Install dependencies
6060
run: |
6161
pip install --upgrade pip

.github/workflows/pr_tests_gpu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up Python
3737
uses: actions/setup-python@v6
3838
with:
39-
python-version: "3.8"
39+
python-version: "3.10"
4040
- name: Install dependencies
4141
run: |
4242
pip install --upgrade pip
@@ -56,7 +56,7 @@ jobs:
5656
- name: Set up Python
5757
uses: actions/setup-python@v6
5858
with:
59-
python-version: "3.8"
59+
python-version: "3.10"
6060
- name: Install dependencies
6161
run: |
6262
pip install --upgrade pip

.github/workflows/pr_torch_dependency_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Python
2323
uses: actions/setup-python@v6
2424
with:
25-
python-version: "3.8"
25+
python-version: "3.10"
2626
- name: Install dependencies
2727
run: |
2828
pip install -e .

.github/workflows/pypi_publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set up Python
2121
uses: actions/setup-python@v6
2222
with:
23-
python-version: '3.8'
23+
python-version: '3.10'
2424

2525
- name: Fetch latest branch
2626
id: fetch_latest_branch
@@ -47,7 +47,7 @@ jobs:
4747
- name: Setup Python
4848
uses: actions/setup-python@v6
4949
with:
50-
python-version: "3.8"
50+
python-version: "3.10"
5151

5252
- name: Install dependencies
5353
run: |

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup Python
2121
uses: actions/setup-python@v6
2222
with:
23-
python-version: 3.8
23+
python-version: 3.10
2424

2525
- name: Install requirements
2626
run: |

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
agreed to in writing, Licensor provides the Work (and each
145145
Contributor provides its Contributions) on an "AS IS" BASIS,
146146
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147-
implied, including, without limitation, any warranties or conditions
147+
implied, including, without limitation, Any warranties or conditions
148148
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149149
PARTICULAR PURPOSE. You are solely responsible for determining the
150150
appropriateness of using or redistributing the Work and assume any

benchmarks/benchmarking_utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import threading
77
from contextlib import nullcontext
88
from dataclasses import dataclass
9-
from typing import Any, Callable, Dict, Optional, Union
9+
from typing import Any, Callable
1010

1111
import pandas as pd
1212
import torch
@@ -91,10 +91,10 @@ def model_init_fn(model_cls, group_offload_kwargs=None, layerwise_upcasting=Fals
9191
class BenchmarkScenario:
9292
name: str
9393
model_cls: ModelMixin
94-
model_init_kwargs: Dict[str, Any]
94+
model_init_kwargs: dict[str, Any]
9595
model_init_fn: Callable
9696
get_model_input_dict: Callable
97-
compile_kwargs: Optional[Dict[str, Any]] = None
97+
compile_kwargs: dict[str, Any] | None = None
9898

9999

100100
@require_torch_gpu
@@ -176,7 +176,7 @@ def run_benchmark(self, scenario: BenchmarkScenario):
176176
result["fullgraph"], result["mode"] = None, None
177177
return result
178178

179-
def run_bencmarks_and_collate(self, scenarios: Union[BenchmarkScenario, list[BenchmarkScenario]], filename: str):
179+
def run_bencmarks_and_collate(self, scenarios: BenchmarkScenario | list[BenchmarkScenario], filename: str):
180180
if not isinstance(scenarios, list):
181181
scenarios = [scenarios]
182182
record_queue = queue.Queue()
@@ -214,10 +214,10 @@ def _run_phase(
214214
*,
215215
model_cls: ModelMixin,
216216
init_fn: Callable,
217-
init_kwargs: Dict[str, Any],
217+
init_kwargs: dict[str, Any],
218218
get_input_fn: Callable,
219-
compile_kwargs: Optional[Dict[str, Any]],
220-
) -> Dict[str, float]:
219+
compile_kwargs: dict[str, Any] | None = None,
220+
) -> dict[str, float]:
221221
# setup
222222
self.pre_benchmark()
223223

examples/cogvideo/train_cogvideox_image_to_video_lora.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ def get_args():
432432
class VideoDataset(Dataset):
433433
def __init__(
434434
self,
435-
instance_data_root: Optional[str] = None,
436-
dataset_name: Optional[str] = None,
437-
dataset_config_name: Optional[str] = None,
435+
instance_data_root: str | None = None,
436+
dataset_name: str | None = None,
437+
dataset_config_name: str | None = None,
438438
caption_column: str = "text",
439439
video_column: str = "video",
440440
height: int = 480,
@@ -443,8 +443,8 @@ def __init__(
443443
max_num_frames: int = 49,
444444
skip_frames_start: int = 0,
445445
skip_frames_end: int = 0,
446-
cache_dir: Optional[str] = None,
447-
id_token: Optional[str] = None,
446+
cache_dir: str | None = None,
447+
id_token: str | None = None,
448448
) -> None:
449449
super().__init__()
450450

0 commit comments

Comments
 (0)