File tree Expand file tree Collapse file tree 2 files changed +0
-4
lines changed Expand file tree Collapse file tree 2 files changed +0
-4
lines changed Original file line number Diff line number Diff line change @@ -1137,7 +1137,6 @@ def _swift_encode(self, inputs: StdTemplateInputs):
1137
1137
# the current response
1138
1138
string_stop_words = tuple (s for s in template_meta .stop_words if isinstance (s , str ))
1139
1139
if self .is_training and not sep_token and not response .endswith (string_stop_words ) or self .task_type == 'embedding' :
1140
- # if self.is_training and not sep_token or self.task_type == 'embedding':
1141
1140
extra_context_list = template_meta .suffix
1142
1141
extra_context_type = ContextType .SUFFIX
1143
1142
elif template_meta .response_prefix :
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ def _find_function_call(single_content: str) -> Optional['Function']:
22
22
matches = pattern .findall (single_content )
23
23
if not matches :
24
24
return
25
-
26
25
name , arguments = matches [0 ]
27
26
return Function (name = name , arguments = arguments )
28
27
@@ -88,15 +87,13 @@ def _find_function_call(single_content: str) -> Optional['Function']:
88
87
func_name_match = re .match (r'^([^\n<]+)' , single_content )
89
88
if not func_name_match :
90
89
return None
91
-
92
90
func_name = func_name_match .group (1 ).strip ()
93
91
arg_key_pattern = re .compile (r'<arg_key>(.*?)</arg_key>' , re .DOTALL )
94
92
arg_value_pattern = re .compile (r'<arg_value>(.*?)</arg_value>' , re .DOTALL )
95
93
keys = arg_key_pattern .findall (single_content )
96
94
values = arg_value_pattern .findall (single_content )
97
95
if len (keys ) != len (values ):
98
96
return None
99
-
100
97
args = {k .strip (): v .strip () for k , v in zip (keys , values )}
101
98
return Function (name = func_name , arguments = json .dumps (args , ensure_ascii = False ))
102
99
You can’t perform that action at this time.
0 commit comments