Open-Sora: Democratizing Efficient Video Production for All
Python
lint: unify setting in `pyproject.toml` (#583)
Jirka Boroveca7b6aacc99b6
diff --git a/.isort.cfg b/.isort.cfgdeleted file mode 100644index ccbf575..0000000--- a/.isort.cfg+++ /dev/null@@ -1,7 +0,0 @@-[settings]-line_length = 120-multi_line_output=3-include_trailing_comma = true-ignore_comments = true-profile = black-honor_noqa = truediff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex 7eb6c12..bce9cb8 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -5,7 +5,7 @@ repos:hooks:- id: autoflakename: autoflake (python)- args: ['--in-place', '--remove-unused-variables', '--remove-all-unused-imports', '--ignore-init-module-imports']+ args: ['--in-place']- repo: https://github.com/pycqa/isortrev: 5.12.0@@ -18,7 +18,6 @@ repos:hooks:- id: blackname: black formatter- args: ['--line-length=120', '--target-version=py37', '--target-version=py38', '--target-version=py39','--target-version=py310']- repo: https://github.com/pre-commit/pre-commit-hooksrev: v4.3.0diff --git a/eval/vbench/calc_vbench.py b/eval/vbench/calc_vbench.pyindex e5570a1..bce29a5 100644--- a/eval/vbench/calc_vbench.py+++ b/eval/vbench/calc_vbench.py@@ -3,7 +3,6 @@ import osimport timeimport torch-from vbench import VBenchfull_info_path = "eval/vbench/VBench_full_info.json"diff --git a/eval/vbench_i2v/calc_vbench_i2v.py b/eval/vbench_i2v/calc_vbench_i2v.pyindex b8d5901..e838c2d 100644--- a/eval/vbench_i2v/calc_vbench_i2v.py+++ b/eval/vbench_i2v/calc_vbench_i2v.py@@ -3,7 +3,6 @@ import osimport timeimport torch-from vbench import VBenchfrom vbench2_beta_i2v import VBenchI2Vdiff --git a/opensora/datasets/read_video.py b/opensora/datasets/read_video.pyindex 6b5da34..2408c4c 100644--- a/opensora/datasets/read_video.py+++ b/opensora/datasets/read_video.py@@ -126,7 +126,6 @@ def _read_from_stream(stream_name: Dict[str, Optional[Union[int, Tuple[int, ...], List[int]]]],filename: Optional[str] = None,) -> List["av.frame.Frame"]:-if pts_unit == "sec":# TODO: we should change all of this from ground up to simply take# sec and convert to MS in C++diff --git a/opensora/schedulers/rf/rectified_flow.py b/opensora/schedulers/rf/rectified_flow.pyindex 8acaff5..f35bebb 100644--- a/opensora/schedulers/rf/rectified_flow.py+++ b/opensora/schedulers/rf/rectified_flow.py@@ -19,7 +19,7 @@ def timestep_transform(for key in ["height", "width", "num_frames"]:if model_kwargs[key].dtype == torch.float16:model_kwargs[key] = model_kwargs[key].float()-+t = t / num_timestepsresolution = model_kwargs["height"] * model_kwargs["width"]ratio_space = (resolution / base_resolution).sqrt()diff --git a/pyproject.toml b/pyproject.tomlnew file mode 100644index 0000000..8cb3c76--- /dev/null+++ b/pyproject.toml@@ -0,0 +1,16 @@+[tool.autoflake]+remove-unused-variables = true+remove-all-unused-imports = true+ignore-init-module-imports = true++[tool.isort]+line_length = 120+multi_line_output = 3+include_trailing_comma = true+ignore_comments = true+profile = "black"+honor_noqa = true++[tool.black]+line-length = 120+target-version = ["py37", "py38", "py39", "py310"]