Skip to content

Commit cf12f01

Browse files
authored
fix: substitute colons with underscores when executing multiturn function calls (#1303)
a colon is not a valid character in a Python identifier, so if model_name, the resulting string (e.g. "model_id_ClassName_instance:v0") is not a legal variable name and eval() raises a SyntaxError
1 parent c7117de commit cf12f01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

berkeley-function-call-leaderboard/bfcl_eval/eval_checker/multi_turn_eval/multi_turn_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def execute_multi_turn_func_call(
3333
instance_name = (
3434
f"{model_name}_{test_entry_id}_{class_name}_instance"
3535
)
36-
instance_name = re.sub(r'[-./]', '_', instance_name)
36+
instance_name = re.sub(r'[-./:]', '_', instance_name)
3737
if instance_name not in globals():
3838
module = importlib.import_module(module_name)
3939
class_ = getattr(module, class_name)

0 commit comments

Comments
 (0)