Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ async def one_req(i: int):
"messages": convs[i],
**sampling_params,
}
return await client.chat_completion({"json": body, "headers": {}})
return await client.engines[0].chat_completion({"json": body, "headers": {}})
else:
# completions: prompt is a string
prompt_str = tokenizer.apply_chat_template(convs[i], add_generation_prompt=True, tokenize=False)
Expand All @@ -340,7 +340,7 @@ async def one_req(i: int):
"prompt": prompt_str,
**sampling_params,
}
return await client.completion({"json": body, "headers": {}})
return await client.engines[0].completion({"json": body, "headers": {}})

tasks = [asyncio.create_task(one_req(i)) for i in range(4)]
# Wait to let it run a bit, then pause generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ async def one_req(i: int):
"messages": convs[i],
**sampling_params,
}
return await client.chat_completion({"json": body, "headers": {}})
return await client.engines[0].chat_completion({"json": body, "headers": {}})
else:
# completions: prompt is a string
prompt_str = tokenizer.apply_chat_template(convs[i], add_generation_prompt=True, tokenize=False)
Expand All @@ -340,7 +340,7 @@ async def one_req(i: int):
"prompt": prompt_str,
**sampling_params,
}
return await client.completion({"json": body, "headers": {}})
return await client.engines[0].completion({"json": body, "headers": {}})

tasks = [asyncio.create_task(one_req(i)) for i in range(4)]
# Wait to let it run a bit, then pause generation
Expand Down
Loading