Crystalcareai
commited on
Update modeling_quiet.py
Browse files- modeling_quiet.py +4 -0
modeling_quiet.py
CHANGED
@@ -1433,6 +1433,10 @@ class QuietForCausalLM(QuietPreTrainedModel, GenerationMixin):
|
|
1433 |
temperature: float = 1.1,
|
1434 |
**kwargs,
|
1435 |
):
|
|
|
|
|
|
|
|
|
1436 |
from .generate import generate
|
1437 |
return generate(self, input_ids=input_ids, attention_mask=attention_mask, max_length=max_length, temperature=temperature, **kwargs)
|
1438 |
|
|
|
1433 |
temperature: float = 1.1,
|
1434 |
**kwargs,
|
1435 |
):
|
1436 |
+
if attention_mask is None:
|
1437 |
+
# Create a default attention mask if not provided
|
1438 |
+
attention_mask = torch.ones_like(input_ids)
|
1439 |
+
|
1440 |
from .generate import generate
|
1441 |
return generate(self, input_ids=input_ids, attention_mask=attention_mask, max_length=max_length, temperature=temperature, **kwargs)
|
1442 |
|