Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
6674a515
"torchvision/vscode:/vscode.git/clone" did not exist on "b572d5e61f785b877d2a04489768fca9ba135e3c"
Unverified
Commit
6674a515
authored
May 08, 2025
by
Aryan
Committed by
GitHub
May 08, 2025
Browse files
Conditionally import torchvision in Cosmos transformer (#11524)
fix
parent
784db0ea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/diffusers/models/transformers/transformer_cosmos.py
src/diffusers/models/transformers/transformer_cosmos.py
+5
-1
No files found.
src/diffusers/models/transformers/transformer_cosmos.py
View file @
6674a515
...
...
@@ -18,9 +18,9 @@ import numpy as np
import
torch
import
torch.nn
as
nn
import
torch.nn.functional
as
F
from
torchvision
import
transforms
from
...configuration_utils
import
ConfigMixin
,
register_to_config
from
...utils
import
is_torchvision_available
from
..attention
import
FeedForward
from
..attention_processor
import
Attention
from
..embeddings
import
Timesteps
...
...
@@ -29,6 +29,10 @@ from ..modeling_utils import ModelMixin
from
..normalization
import
RMSNorm
if
is_torchvision_available
():
from
torchvision
import
transforms
class
CosmosPatchEmbed
(
nn
.
Module
):
def
__init__
(
self
,
in_channels
:
int
,
out_channels
:
int
,
patch_size
:
Tuple
[
int
,
int
,
int
],
bias
:
bool
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment