prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [tensor] fix some unittests
  
  [tensor] fix some unittests
  
  [tensor] fix some unittests
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `applications/Chat/coati/models/base/actor.py`
  Content:
  ```
  1 from typing import Optional
  2 
  3 import torch
  4 import torch.nn as nn
  5 
  6 from ..lora import LoRAModule
  7 
  8 
  9 class Actor(LoRAModule):
  10     """
  11     Actor model base class.
  12 
  13     Args:
  14         model (nn.Module): Actor Model.
  15         lora_rank (int): LoRA rank.
  16         lora_train_bias (str): LoRA bias training mode.
  17     """
  18 
  19     def __init__(self, model: nn.Module, lora_rank: int = 0, lora_train_bias: str = 'none') -> None:
  20         super().__init__(lora_rank=lora_rank, lora_train_bias=lora_train_bias)
  21         self.model = model
  22         self.convert_to_lora()
  23 
  24     def forward(self,
  25                 input_ids: torch.LongTensor,
  26                 attention_mask: Optional[torch.Tensor] = None,
  27                 **model_kwargs,  # HACK: `generate` method may pass more kwargs
  28                 ) -> torch.Tensor:
  29         """Returns model output.
  30         """
  31         output = self.model(
  32             input_ids,
  33             attention_mask=attention_mask,
  34             **model_kwargs
  35         )
  36         return output
  37
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/applications/Chat/coati/models/base/actor.py b/applications/Chat/coati/models/base/actor.py
  --- a/applications/Chat/coati/models/base/actor.py
  +++ b/applications/Chat/coati/models/base/actor.py
  @@ -21,16 +21,13 @@
           self.model = model
           self.convert_to_lora()
   
  -    def forward(self,
  -                input_ids: torch.LongTensor,
  -                attention_mask: Optional[torch.Tensor] = None,
  -                **model_kwargs,  # HACK: `generate` method may pass more kwargs
  -                ) -> torch.Tensor:
  +    def forward(
  +            self,
  +            input_ids: torch.LongTensor,
  +            attention_mask: Optional[torch.Tensor] = None,
  +            **model_kwargs,    # HACK: `generate` method may pass more kwargs
  +    ) -> torch.Tensor:
           """Returns model output.
           """
  -        output = self.model(
  -            input_ids,
  -            attention_mask=attention_mask,
  -            **model_kwargs
  -        )
  +        output = self.model(input_ids, attention_mask=attention_mask, **model_kwargs)
           return output
  
verification_info: {"golden_diff": "diff --git a/applications/Chat/coati/models/base/actor.py b/applications/Chat/coati/models/base/actor.py\n--- a/applications/Chat/coati/models/base/actor.py\n+++ b/applications/Chat/coati/models/base/actor.py\n@@ -21,16 +21,13 @@\n         self.model = model\n         self.convert_to_lora()\n \n-    def forward(self,\n-                input_ids: torch.LongTensor,\n-                attention_mask: Optional[torch.Tensor] = None,\n-                **model_kwargs,  # HACK: `generate` method may pass more kwargs\n-                ) -> torch.Tensor:\n+    def forward(\n+            self,\n+            input_ids: torch.LongTensor,\n+            attention_mask: Optional[torch.Tensor] = None,\n+            **model_kwargs,    # HACK: `generate` method may pass more kwargs\n+    ) -> torch.Tensor:\n         \"\"\"Returns model output.\n         \"\"\"\n-        output = self.model(\n-            input_ids,\n-            attention_mask=attention_mask,\n-            **model_kwargs\n-        )\n+        output = self.model(input_ids, attention_mask=attention_mask, **model_kwargs)\n         return output\n", "issue": "[tensor] fix some unittests\n\n[tensor] fix some unittests\n\n[tensor] fix some unittests\n\n", "before_files": [{"content": "from typing import Optional\n\nimport torch\nimport torch.nn as nn\n\nfrom ..lora import LoRAModule\n\n\nclass Actor(LoRAModule):\n    \"\"\"\n    Actor model base class.\n\n    Args:\n        model (nn.Module): Actor Model.\n        lora_rank (int): LoRA rank.\n        lora_train_bias (str): LoRA bias training mode.\n    \"\"\"\n\n    def __init__(self, model: nn.Module, lora_rank: int = 0, lora_train_bias: str = 'none') -> None:\n        super().__init__(lora_rank=lora_rank, lora_train_bias=lora_train_bias)\n        self.model = model\n        self.convert_to_lora()\n\n    def forward(self,\n                input_ids: torch.LongTensor,\n                attention_mask: Optional[torch.Tensor] = None,\n                **model_kwargs,  # HACK: `generate` method may pass more kwargs\n                ) -> torch.Tensor:\n        \"\"\"Returns model output.\n        \"\"\"\n        output = self.model(\n            input_ids,\n            attention_mask=attention_mask,\n            **model_kwargs\n        )\n        return output\n", "path": "applications/Chat/coati/models/base/actor.py"}], "after_files": [{"content": "from typing import Optional\n\nimport torch\nimport torch.nn as nn\n\nfrom ..lora import LoRAModule\n\n\nclass Actor(LoRAModule):\n    \"\"\"\n    Actor model base class.\n\n    Args:\n        model (nn.Module): Actor Model.\n        lora_rank (int): LoRA rank.\n        lora_train_bias (str): LoRA bias training mode.\n    \"\"\"\n\n    def __init__(self, model: nn.Module, lora_rank: int = 0, lora_train_bias: str = 'none') -> None:\n        super().__init__(lora_rank=lora_rank, lora_train_bias=lora_train_bias)\n        self.model = model\n        self.convert_to_lora()\n\n    def forward(\n            self,\n            input_ids: torch.LongTensor,\n            attention_mask: Optional[torch.Tensor] = None,\n            **model_kwargs,    # HACK: `generate` method may pass more kwargs\n    ) -> torch.Tensor:\n        \"\"\"Returns model output.\n        \"\"\"\n        output = self.model(input_ids, attention_mask=attention_mask, **model_kwargs)\n        return output\n", "path": "applications/Chat/coati/models/base/actor.py"}]}