Skip to content

[Black] Update black #433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion examples/textual_inversion/textual_inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ def __init__(
placeholder_token="*",
center_crop=False,
):

self.data_root = data_root
self.tokenizer = tokenizer
self.learnable_property = learnable_property
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
_deps = [
"Pillow",
"accelerate>=0.11.0",
"black==22.3",
"black==22.8",
"datasets",
"filelock",
"flake8>=3.8.3",
Expand Down Expand Up @@ -167,7 +167,7 @@ def run(self):


extras = {}
extras["quality"] = ["black==22.3", "isort>=5.5.4", "flake8>=3.8.3", "hf-doc-builder"]
extras["quality"] = ["black==22.8", "isort>=5.5.4", "flake8>=3.8.3", "hf-doc-builder"]
extras["docs"] = ["hf-doc-builder"]
extras["training"] = ["accelerate", "datasets", "tensorboard", "modelcards"]
extras["test"] = ["datasets", "onnxruntime", "pytest", "pytest-timeout", "pytest-xdist", "scipy", "transformers"]
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/dependency_versions_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
deps = {
"Pillow": "Pillow",
"accelerate": "accelerate>=0.11.0",
"black": "black==22.3",
"black": "black==22.8",
"datasets": "datasets",
"filelock": "filelock",
"flake8": "flake8>=3.8.3",
Expand Down
3 changes: 0 additions & 3 deletions src/diffusers/models/unet_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,6 @@ def __init__(

def forward(self, hidden_states, res_hidden_states_tuple, temb=None):
for resnet, attn in zip(self.resnets, self.attentions):

# pop res hidden states
res_hidden_states = res_hidden_states_tuple[-1]
res_hidden_states_tuple = res_hidden_states_tuple[:-1]
Expand Down Expand Up @@ -1075,7 +1074,6 @@ def set_attention_slice(self, slice_size):

def forward(self, hidden_states, res_hidden_states_tuple, temb=None, encoder_hidden_states=None):
for resnet, attn in zip(self.resnets, self.attentions):

# pop res hidden states
res_hidden_states = res_hidden_states_tuple[-1]
res_hidden_states_tuple = res_hidden_states_tuple[:-1]
Expand Down Expand Up @@ -1139,7 +1137,6 @@ def __init__(

def forward(self, hidden_states, res_hidden_states_tuple, temb=None):
for resnet in self.resnets:

# pop res hidden states
res_hidden_states = res_hidden_states_tuple[-1]
res_hidden_states_tuple = res_hidden_states_tuple[:-1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,6 @@ def forward(
output_hidden_states=None,
return_dict=None,
):

outputs = self.model(
input_ids,
attention_mask=attention_mask,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def __call__(
return_dict: bool = True,
**kwargs,
) -> Union[Tuple, ImagePipelineOutput]:

r"""
Args:
batch_size (`int`, *optional*, defaults to 1):
Expand Down
2 changes: 0 additions & 2 deletions src/diffusers/schedulers/scheduling_ddpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def __init__(
clip_sample: bool = True,
tensor_format: str = "pt",
):

if trained_betas is not None:
self.betas = np.asarray(trained_betas)
elif beta_schedule == "linear":
Expand Down Expand Up @@ -251,7 +250,6 @@ def add_noise(
noise: Union[torch.FloatTensor, np.ndarray],
timesteps: Union[torch.IntTensor, np.ndarray],
) -> Union[torch.FloatTensor, np.ndarray]:

sqrt_alpha_prod = self.alphas_cumprod[timesteps] ** 0.5
sqrt_alpha_prod = self.match_shape(sqrt_alpha_prod, original_samples)
sqrt_one_minus_alpha_prod = (1 - self.alphas_cumprod[timesteps]) ** 0.5
Expand Down
1 change: 0 additions & 1 deletion src/diffusers/schedulers/scheduling_sde_vp.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class ScoreSdeVpScheduler(SchedulerMixin, ConfigMixin):

@register_to_config
def __init__(self, num_train_timesteps=2000, beta_min=0.1, beta_max=20, sampling_eps=1e-3, tensor_format="np"):

self.sigmas = None
self.discrete_sigmas = None
self.timesteps = None
Expand Down
4 changes: 0 additions & 4 deletions src/diffusers/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,14 @@ def _get_default_logging_level():


def _get_library_name() -> str:

return __name__.split(".")[0]


def _get_library_root_logger() -> logging.Logger:

return logging.getLogger(_get_library_name())


def _configure_library_root_logger() -> None:

global _default_handler

with _lock:
Expand All @@ -93,7 +90,6 @@ def _configure_library_root_logger() -> None:


def _reset_library_root_logger() -> None:

global _default_handler

with _lock:
Expand Down