mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-13 05:42:22 +01:00
server-tests : strip "chat" from base_url in oai_chat_completions
This commit is contained in:
parent
71b50a148c
commit
959c057bd9
@ -903,8 +903,8 @@ async def request_completion(prompt,
|
|||||||
async def oai_chat_completions(user_prompt,
|
async def oai_chat_completions(user_prompt,
|
||||||
seed,
|
seed,
|
||||||
system_prompt,
|
system_prompt,
|
||||||
base_url,
|
base_url: str,
|
||||||
base_path,
|
base_path: str,
|
||||||
async_client,
|
async_client,
|
||||||
debug=False,
|
debug=False,
|
||||||
temperature=None,
|
temperature=None,
|
||||||
@ -993,7 +993,7 @@ async def oai_chat_completions(user_prompt,
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
openai.api_key = user_api_key
|
openai.api_key = user_api_key
|
||||||
openai.base_url = f'{base_url}{base_path}/'
|
openai.base_url = f'{base_url}{base_path.removesuffix("chat")}'
|
||||||
assert model is not None
|
assert model is not None
|
||||||
chat_completion = openai.chat.completions.create(
|
chat_completion = openai.chat.completions.create(
|
||||||
messages=payload['messages'],
|
messages=payload['messages'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user