Skip to content

Commit

Permalink
fix finish reason
Browse files Browse the repository at this point in the history
  • Loading branch information
Cppowboy committed Nov 4, 2024
1 parent 465183c commit e9e2af8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vllm/entrypoints/openai/tool_parsers/minicpm_tool_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def extract_tool_calls(
return ret
else:
return ExtractedToolCallInformation(
tools_called=True,
tools_called=False,
tool_calls=[],
content=msg.get("content", None),
)
Expand Down Expand Up @@ -266,8 +266,8 @@ def resolve_ast_by_type(value):
output = tuple(resolve_ast_by_type(v) for v in value.elts)
elif isinstance(value, ast.Lambda):
output = ast.literal_eval(
ast.unparse( # type: ignore
value.body[0].value)) # type: ignore
ast.unparse(value.body[0].value) # type: ignore
) # type: ignore
elif isinstance(value, ast.Ellipsis):
output = "..."
elif isinstance(value, ast.Subscript):
Expand All @@ -276,8 +276,8 @@ def resolve_ast_by_type(value):
except Exception as e:
logger.error("Error parsing tool call: %s", str(e))
output = (
ast.unparse(value.value) + "[" + # type: ignore
ast.unparse(value.slice) + "]") # type: ignore
ast.unparse(value.value) + "[" # type: ignore
+ ast.unparse(value.slice) + "]") # type: ignore
else:
raise Exception(f"Unsupported AST type: {type(value)}")
return output

0 comments on commit e9e2af8

Please sign in to comment.