Skip to content

Commit b537398

Browse files
author
Your Name
committed
重构代码
1 parent a2c1be0 commit b537398

File tree

4 files changed

+97
-92
lines changed

4 files changed

+97
-92
lines changed

swift/plugin/tool_call.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
from typing import Tuple,Any, Optional
1+
from typing import Tuple, Any, Optional
2+
3+
24
class TOOL_CALL:
5+
36
def __call__(self, completion: str) -> Tuple[Any, bool, Optional[float]]:
47
raise NotImplementedError
58

69

7-
tools = {
8-
9-
}
10+
tools = {}

swift/trainers/arguments.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ class GRPOArgumentsMixin:
104104
offload_optimizer: bool = False
105105
offload_model: bool = False
106106
gc_collect_after_offload: bool = False
107-
is_reward_tool_call:bool = True #是否额外单独计算每个tool call的format得分
108-
tool_call_weight:float = 1.0
109-
tool_call:str = None
107+
is_reward_tool_call: bool = True #是否额外单独计算每个tool call的format得分
108+
tool_call_weight: float = 1.0
109+
tool_call: str = None
110110

111111

112112
@dataclass

swift/trainers/rlhf_arguments.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass, field
2-
from typing import List, Optional,Callable
2+
from typing import List, Optional, Callable
33

44
from trl import CPOConfig as HfCPOConfig
55
from trl import DPOConfig as HfDPOConfig

0 commit comments

Comments
 (0)