Skip to content

Commit

Permalink
fix updated linter
Browse files Browse the repository at this point in the history
  • Loading branch information
adefossez committed Aug 1, 2023
1 parent 207888c commit 539ec04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions audiocraft/modules/conditioners.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def nullify_condition(condition: ConditionType, dim: int = 1):
ConditionType: a tuple of null condition and mask
"""
assert dim != 0, "dim cannot be the batch dimension!"
assert type(condition) == tuple and \
type(condition[0]) == Tensor and \
type(condition[1]) == Tensor, "'nullify_condition' got an unexpected input type!"
assert isinstance(condition, tuple) and \
isinstance(condition[0], Tensor) and \
isinstance(condition[1], Tensor), "'nullify_condition' got an unexpected input type!"
cond, mask = condition
B = cond.shape[0]
last_dim = cond.dim() - 1
Expand Down Expand Up @@ -772,7 +772,7 @@ def tokenize(self, inputs: tp.List[ConditioningAttributes]) -> tp.Dict[str, tp.A
inputs (list[ConditioningAttribres]): List of ConditioningAttributes objects containing
text and wav conditions.
"""
assert all([type(x) == ConditioningAttributes for x in inputs]), \
assert all([isinstance(x, ConditioningAttributes) for x in inputs]), \
"got unexpected types input for conditioner! should be tp.List[ConditioningAttributes]" \
f" but types were {set([type(x) for x in inputs])}"

Expand Down

0 comments on commit 539ec04

Please sign in to comment.