workaround for tool calling
This commit is contained in:
parent
aa4ccd03d4
commit
a52610fb19
1 changed files with 2 additions and 2 deletions
|
|
@ -454,11 +454,11 @@ async def generate_tool_calls(
|
|||
if gen["stop_str"] in tool_data.tool_call_start:
|
||||
if "text" in gen:
|
||||
# non streaming, all generations will have the text they generated
|
||||
pre_tool_prompt = await apply_chat_template(data, gen["text"])
|
||||
pre_tool_prompt, _ = await apply_chat_template(data, gen["text"])
|
||||
elif current_generations is not None:
|
||||
# streaming, we wont have text in the generation,
|
||||
# we'll have to use the current_generations
|
||||
pre_tool_prompt = await apply_chat_template(data, current_generations)
|
||||
pre_tool_prompt, _ = await apply_chat_template(data, current_generations)
|
||||
|
||||
gen_tasks.append(
|
||||
asyncio.create_task(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue