mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
fix(huggingface_restapi.py): fix hf embeddings optional param processing
This commit is contained in:
parent
ebe1275fb0
commit
cac91dcae4
2 changed files with 33 additions and 1 deletions
|
@ -761,6 +761,8 @@ async def test_hf_embedddings_with_optional_params(sync_mode):
|
|||
response = embedding(
|
||||
model="huggingface/jinaai/jina-embeddings-v2-small-en",
|
||||
input=["good morning from litellm"],
|
||||
top_p=10,
|
||||
top_k=10,
|
||||
wait_for_model=True,
|
||||
client=client,
|
||||
)
|
||||
|
@ -768,6 +770,8 @@ async def test_hf_embedddings_with_optional_params(sync_mode):
|
|||
response = await litellm.aembedding(
|
||||
model="huggingface/jinaai/jina-embeddings-v2-small-en",
|
||||
input=["good morning from litellm"],
|
||||
top_p=10,
|
||||
top_k=10,
|
||||
wait_for_model=True,
|
||||
client=client,
|
||||
)
|
||||
|
@ -781,3 +785,5 @@ async def test_hf_embedddings_with_optional_params(sync_mode):
|
|||
json_data = json.loads(mock_client.call_args.kwargs["data"])
|
||||
assert "wait_for_model" in json_data["options"]
|
||||
assert json_data["options"]["wait_for_model"] is True
|
||||
assert json_data["parameters"]["top_p"] == 10
|
||||
assert json_data["parameters"]["top_k"] == 10
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue