prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [BUG]: typing miss of kwargs
  ### 🐛 Describe the bug
  
  When I tried to train prompts with opt model, the following error was occurred.
  
  ```
  Traceback (most recent call last):
    File "/home/xxx/workspace/ColossalAI/applications/ChatGPT/examples/train_prompts.py", line 127, in <module>
      main(args)
    File "/home/xxx/workspace/ColossalAI/applications/ChatGPT/examples/train_prompts.py", line 42, in main
      critic = OPTCritic(lora_rank=args.lora_rank).cuda()
    File "/home/xxx/.pyenv/versions/3.9.9/lib/python3.9/site-packages/chatgpt/models/opt/opt_critic.py", line 38, in __init__
      super().__init__(model, value_head, lora_rank, lora_train_bias, **kwargs)
  NameError: name 'kwargs' is not defined
  ```
  
  To Reproduce
  
  ```
  torchrun --standalone --nproc_per_node=2 train_prompts.py prompts.csv --model opt --strategy colossalai_zero2
  ```
  
  
  
  ### Environment
  
  _No response_
  
  </issue>
  <code>
  [start of applications/ChatGPT/chatgpt/models/opt/opt_critic.py]
  1 from typing import Optional
  2 
  3 import torch.nn as nn
  4 from transformers.models.opt.configuration_opt import OPTConfig
  5 from transformers.models.opt.modeling_opt import OPTModel
  6 
  7 from ..base import Critic
  8 
  9 
  10 class OPTCritic(Critic):
  11     """
  12     OPT Critic model.
  13 
  14     Args:
  15         pretrained (str): Pretrained model name or path.
  16         config (OPTConfig): Model config.
  17         checkpoint (bool): Enable gradient checkpointing.
  18         lora_rank (int): Rank of the low-rank approximation.
  19         lora_train_bias (str): LoRA bias training mode.
  20     """
  21 
  22     def __init__(self,
  23                  pretrained: Optional[str] = None,
  24                  config: Optional[OPTConfig] = None,
  25                  checkpoint: bool = False,
  26                  lora_rank: int = 0,
  27                  lora_train_bias: str = 'none',
  28                  **kargs) -> None:
  29         if pretrained is not None:
  30             model = OPTModel.from_pretrained(pretrained)
  31         elif config is not None:
  32             model = OPTModel(config)
  33         else:
  34             model = OPTModel(OPTConfig())
  35         if checkpoint:
  36             model.gradient_checkpointing_enable()
  37         value_head = nn.Linear(model.config.hidden_size, 1)
  38         super().__init__(model, value_head, lora_rank, lora_train_bias, **kwargs)
  39
  [end of applications/ChatGPT/chatgpt/models/opt/opt_critic.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/applications/ChatGPT/chatgpt/models/opt/opt_critic.py b/applications/ChatGPT/chatgpt/models/opt/opt_critic.py
  --- a/applications/ChatGPT/chatgpt/models/opt/opt_critic.py
  +++ b/applications/ChatGPT/chatgpt/models/opt/opt_critic.py
  @@ -25,7 +25,7 @@
                    checkpoint: bool = False,
                    lora_rank: int = 0,
                    lora_train_bias: str = 'none',
  -                 **kargs) -> None:
  +                 **kwargs) -> None:
           if pretrained is not None:
               model = OPTModel.from_pretrained(pretrained)
           elif config is not None:
  
verification_info: {"golden_diff": "diff --git a/applications/ChatGPT/chatgpt/models/opt/opt_critic.py b/applications/ChatGPT/chatgpt/models/opt/opt_critic.py\n--- a/applications/ChatGPT/chatgpt/models/opt/opt_critic.py\n+++ b/applications/ChatGPT/chatgpt/models/opt/opt_critic.py\n@@ -25,7 +25,7 @@\n                  checkpoint: bool = False,\n                  lora_rank: int = 0,\n                  lora_train_bias: str = 'none',\n-                 **kargs) -> None:\n+                 **kwargs) -> None:\n         if pretrained is not None:\n             model = OPTModel.from_pretrained(pretrained)\n         elif config is not None:\n", "issue": "[BUG]: typing miss of kwargs\n### \ud83d\udc1b Describe the bug\n\nWhen I tried to train prompts with opt model, the following error was occurred.\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/xxx/workspace/ColossalAI/applications/ChatGPT/examples/train_prompts.py\", line 127, in <module>\r\n    main(args)\r\n  File \"/home/xxx/workspace/ColossalAI/applications/ChatGPT/examples/train_prompts.py\", line 42, in main\r\n    critic = OPTCritic(lora_rank=args.lora_rank).cuda()\r\n  File \"/home/xxx/.pyenv/versions/3.9.9/lib/python3.9/site-packages/chatgpt/models/opt/opt_critic.py\", line 38, in __init__\r\n    super().__init__(model, value_head, lora_rank, lora_train_bias, **kwargs)\r\nNameError: name 'kwargs' is not defined\r\n```\r\n\r\nTo Reproduce\r\n\r\n```\r\ntorchrun --standalone --nproc_per_node=2 train_prompts.py prompts.csv --model opt --strategy colossalai_zero2\r\n```\r\n\r\n\n\n### Environment\n\n_No response_\n", "before_files": [{"content": "from typing import Optional\n\nimport torch.nn as nn\nfrom transformers.models.opt.configuration_opt import OPTConfig\nfrom transformers.models.opt.modeling_opt import OPTModel\n\nfrom ..base import Critic\n\n\nclass OPTCritic(Critic):\n    \"\"\"\n    OPT Critic model.\n\n    Args:\n        pretrained (str): Pretrained model name or path.\n        config (OPTConfig): Model config.\n        checkpoint (bool): Enable gradient checkpointing.\n        lora_rank (int): Rank of the low-rank approximation.\n        lora_train_bias (str): LoRA bias training mode.\n    \"\"\"\n\n    def __init__(self,\n                 pretrained: Optional[str] = None,\n                 config: Optional[OPTConfig] = None,\n                 checkpoint: bool = False,\n                 lora_rank: int = 0,\n                 lora_train_bias: str = 'none',\n                 **kargs) -> None:\n        if pretrained is not None:\n            model = OPTModel.from_pretrained(pretrained)\n        elif config is not None:\n            model = OPTModel(config)\n        else:\n            model = OPTModel(OPTConfig())\n        if checkpoint:\n            model.gradient_checkpointing_enable()\n        value_head = nn.Linear(model.config.hidden_size, 1)\n        super().__init__(model, value_head, lora_rank, lora_train_bias, **kwargs)\n", "path": "applications/ChatGPT/chatgpt/models/opt/opt_critic.py"}]}