-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Description
in src/flux/modules/conditioner.py
class HFEmbedder(nn.Module):
def init(self, version: str, max_length: int, **hf_kwargs):
xxxx
def forward(self, text: list[str]) -> Tensor:
batch_encoding = self.tokenizer(
text,
truncation=True,
max_length=self.max_length,
return_length=False,
return_overflowing_tokens=False,
padding="max_length",
return_tensors="pt",
)
outputs = self.hf_module(
input_ids=batch_encoding["input_ids"].to(self.hf_module.device),
attention_mask=None,
output_hidden_states=False,
)
return outputs[self.output_key]
in forward() function, when we call self.hf_module to encode the text prompt, why don't we pass attention_mask to handle the padding token?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels