fixing /v1/embeddings
This commit is contained in:
parent
49b1ea16d0
commit
bd21906687
1 changed files with 2 additions and 1 deletions
|
|
@ -1113,7 +1113,8 @@ async def openai_embedding_proxy(request: Request):
|
||||||
api_key = config.api_keys[endpoint]
|
api_key = config.api_keys[endpoint]
|
||||||
else:
|
else:
|
||||||
api_key = "ollama"
|
api_key = "ollama"
|
||||||
oclient = openai.AsyncOpenAI(base_url=endpoint+"/v1", api_key=api_key)
|
base_url = ep2base(endpoint)
|
||||||
|
oclient = openai.AsyncOpenAI(base_url=base_url, api_key=api_key)
|
||||||
|
|
||||||
# 3. Async generator that streams embedding data and decrements the counter
|
# 3. Async generator that streams embedding data and decrements the counter
|
||||||
async_gen = await oclient.embeddings.create(input=[doc], model=model)
|
async_gen = await oclient.embeddings.create(input=[doc], model=model)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue