Commit 77c469e1 authored by Junming Wu's avatar Junming Wu Committed by binmakeswell
Browse files

[NFC] polish applications/Chat/coati/models/base/actor.py code style (#4248)

parent 915ed8be
...@@ -21,16 +21,13 @@ class Actor(LoRAModule): ...@@ -21,16 +21,13 @@ class Actor(LoRAModule):
self.model = model self.model = model
self.convert_to_lora() self.convert_to_lora()
def forward(self, def forward(
input_ids: torch.LongTensor, self,
attention_mask: Optional[torch.Tensor] = None, input_ids: torch.LongTensor,
**model_kwargs, # HACK: `generate` method may pass more kwargs attention_mask: Optional[torch.Tensor] = None,
) -> torch.Tensor: **model_kwargs, # HACK: `generate` method may pass more kwargs
) -> torch.Tensor:
"""Returns model output. """Returns model output.
""" """
output = self.model( output = self.model(input_ids, attention_mask=attention_mask, **model_kwargs)
input_ids,
attention_mask=attention_mask,
**model_kwargs
)
return output return output
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment