Skip to content
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

Fixes type #264

Merged
merged 2 commits into from
Feb 16, 2023
Merged
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
10 changes: 5 additions & 5 deletions generative/inferers/inferer.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def sample(
save_intermediates: bool | None = False,
intermediate_steps: int | None = 100,
conditioning: torch.Tensor | None = None,
verbose: bool | None = True,
verbose: bool = True,
) -> torch.Tensor | tuple[torch.Tensor, list[torch.Tensor]]:
"""
Args:
Expand Down Expand Up @@ -114,7 +114,7 @@ def get_likelihood(
conditioning: torch.Tensor | None = None,
original_input_range: tuple | None = (0, 255),
scaled_input_range: tuple | None = (0, 1),
verbose: bool | None = True,
verbose: bool = True,
) -> torch.Tensor | tuple[torch.Tensor, list[torch.Tensor]]:
"""
Computes the log-likelihoods for an input.
Expand Down Expand Up @@ -321,7 +321,7 @@ def sample(
save_intermediates: bool | None = False,
intermediate_steps: int | None = 100,
conditioning: torch.Tensor | None = None,
verbose: bool | None = True,
verbose: bool = True,
) -> torch.Tensor | tuple[torch.Tensor, list[torch.Tensor]]:
"""
Args:
Expand Down Expand Up @@ -371,7 +371,7 @@ def get_likelihood(
conditioning: torch.Tensor | None = None,
original_input_range: tuple | None = (0, 255),
scaled_input_range: tuple | None = (0, 1),
verbose: bool | None = True,
verbose: bool = True,
resample_latent_likelihoods: bool = False,
resample_interpolation_mode: str = "nearest",
) -> torch.Tensor | tuple[torch.Tensor, list[torch.Tensor]]:
Expand Down Expand Up @@ -471,7 +471,7 @@ def sample(
conditioning: torch.Tensor | None = None,
temperature: float = 1.0,
top_k: int | None = None,
verbose: bool | None = True,
verbose: bool = True,
) -> torch.Tensor:
"""
Sampling function for the VQVAE + Transformer model.
Expand Down