Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
b299f93
1
Parent(s):
63432be
modified: src/flux/modules/conditioner.py
Browse files- src/flux/__pycache__/__init__.cpython-310.pyc +0 -0
- src/flux/__pycache__/_version.cpython-310.pyc +0 -0
- src/flux/__pycache__/math.cpython-310.pyc +0 -0
- src/flux/__pycache__/model.cpython-310.pyc +0 -0
- src/flux/__pycache__/sampling.cpython-310.pyc +0 -0
- src/flux/__pycache__/util.cpython-310.pyc +0 -0
- src/flux/modules/__pycache__/autoencoder.cpython-310.pyc +0 -0
- src/flux/modules/__pycache__/conditioner.cpython-310.pyc +0 -0
- src/flux/modules/__pycache__/layers.cpython-310.pyc +0 -0
- src/flux/modules/conditioner.py +3 -7
src/flux/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/__init__.cpython-310.pyc and b/src/flux/__pycache__/__init__.cpython-310.pyc differ
|
|
|
src/flux/__pycache__/_version.cpython-310.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/_version.cpython-310.pyc and b/src/flux/__pycache__/_version.cpython-310.pyc differ
|
|
|
src/flux/__pycache__/math.cpython-310.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/math.cpython-310.pyc and b/src/flux/__pycache__/math.cpython-310.pyc differ
|
|
|
src/flux/__pycache__/model.cpython-310.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/model.cpython-310.pyc and b/src/flux/__pycache__/model.cpython-310.pyc differ
|
|
|
src/flux/__pycache__/sampling.cpython-310.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/sampling.cpython-310.pyc and b/src/flux/__pycache__/sampling.cpython-310.pyc differ
|
|
|
src/flux/__pycache__/util.cpython-310.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/util.cpython-310.pyc and b/src/flux/__pycache__/util.cpython-310.pyc differ
|
|
|
src/flux/modules/__pycache__/autoencoder.cpython-310.pyc
CHANGED
|
Binary files a/src/flux/modules/__pycache__/autoencoder.cpython-310.pyc and b/src/flux/modules/__pycache__/autoencoder.cpython-310.pyc differ
|
|
|
src/flux/modules/__pycache__/conditioner.cpython-310.pyc
CHANGED
|
Binary files a/src/flux/modules/__pycache__/conditioner.cpython-310.pyc and b/src/flux/modules/__pycache__/conditioner.cpython-310.pyc differ
|
|
|
src/flux/modules/__pycache__/layers.cpython-310.pyc
CHANGED
|
Binary files a/src/flux/modules/__pycache__/layers.cpython-310.pyc and b/src/flux/modules/__pycache__/layers.cpython-310.pyc differ
|
|
|
src/flux/modules/conditioner.py
CHANGED
|
@@ -115,14 +115,10 @@ class HFEmbedder(nn.Module):
|
|
| 115 |
max_pos_emb = getattr(self.hf_module.config, 'max_position_embeddings', -1)
|
| 116 |
if max_pos_emb > 0 and position_ids.max() >= max_pos_emb:
|
| 117 |
raise ValueError(f"Generated position_ids max ({position_ids.max().item()}) >= model's max_position_embeddings ({max_pos_emb})")
|
| 118 |
-
|
|
|
|
| 119 |
try:
|
| 120 |
-
outputs = self.hf_module(
|
| 121 |
-
input_ids=input_ids,
|
| 122 |
-
attention_mask=attention_mask,
|
| 123 |
-
output_hidden_states=False,
|
| 124 |
-
position_ids=position_ids
|
| 125 |
-
)
|
| 126 |
except IndexError as e:
|
| 127 |
# 捕获并提供更详细的错误上下文
|
| 128 |
print(f"*** IndexError caught during model forward pass ***")
|
|
|
|
| 115 |
max_pos_emb = getattr(self.hf_module.config, 'max_position_embeddings', -1)
|
| 116 |
if max_pos_emb > 0 and position_ids.max() >= max_pos_emb:
|
| 117 |
raise ValueError(f"Generated position_ids max ({position_ids.max().item()}) >= model's max_position_embeddings ({max_pos_emb})")
|
| 118 |
+
# Pass the explicitly created position_ids to the model
|
| 119 |
+
model_kwargs["position_ids"] = position_ids
|
| 120 |
try:
|
| 121 |
+
outputs = self.hf_module(**model_kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
except IndexError as e:
|
| 123 |
# 捕获并提供更详细的错误上下文
|
| 124 |
print(f"*** IndexError caught during model forward pass ***")
|