Skip to content
Open
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 src/diffusers/pipelines/deepfloyd_if/pipeline_if.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ def __init__(
)
self.register_to_config(requires_safety_checker=requires_safety_checker)

@torch.no_grad()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do a short deprecation cycle? Otherwise, people currently are using encode_prompt without torch.no_grad may not even notice this

someth8ing like

if torch.is_grad_enabled():
    deprecate(...)
with torch.no_grad():
   ...

def encode_prompt(
self,
prompt: str | list[str],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ def __init__(
)
self.register_to_config(requires_safety_checker=requires_safety_checker)

@torch.no_grad()
def encode_prompt(
self,
prompt: str | list[str],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ def _clean_caption(self, caption):

return caption.strip()

@torch.no_grad()
# Copied from diffusers.pipelines.deepfloyd_if.pipeline_if.IFPipeline.encode_prompt
def encode_prompt(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ def __init__(
)
self.register_to_config(requires_safety_checker=requires_safety_checker)

@torch.no_grad()
# Copied from diffusers.pipelines.deepfloyd_if.pipeline_if.IFPipeline.encode_prompt
def encode_prompt(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ def _clean_caption(self, caption):

return caption.strip()

@torch.no_grad()
# Copied from diffusers.pipelines.deepfloyd_if.pipeline_if.IFPipeline.encode_prompt
def encode_prompt(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ def _clean_caption(self, caption):

return caption.strip()

@torch.no_grad()
# Copied from diffusers.pipelines.deepfloyd_if.pipeline_if.IFPipeline.encode_prompt
def encode_prompt(
self,
Expand Down
Loading