Update modeling_quasrav4.py
Browse files- modeling_quasrav4.py +4 -0
modeling_quasrav4.py
CHANGED
@@ -266,3 +266,7 @@ class InfinityFormerForCausalLM(InfinityFormerPreTrainedModel):
|
|
266 |
output = (lm_logits,) + outputs[1:]
|
267 |
return ((loss,) + output) if loss is not None else output
|
268 |
return CausalLMOutputWithPast(loss=loss, logits=lm_logits, past_key_values=outputs.past_key_values, hidden_states=outputs.hidden_states, attentions=outputs.attentions)
|
|
|
|
|
|
|
|
|
|
266 |
output = (lm_logits,) + outputs[1:]
|
267 |
return ((loss,) + output) if loss is not None else output
|
268 |
return CausalLMOutputWithPast(loss=loss, logits=lm_logits, past_key_values=outputs.past_key_values, hidden_states=outputs.hidden_states, attentions=outputs.attentions)
|
269 |
+
|
270 |
+
def set_to_generation_mode(self):
|
271 |
+
"""Sets the model to generation mode."""
|
272 |
+
self.eval() # Set the entire model to evaluation mode
|