[Bugfix] Fix encoding_format in examples/openai_embedding_client.py (#6755)
This commit is contained in:
@@ -13,11 +13,14 @@ client = OpenAI(
|
||||
models = client.models.list()
|
||||
model = models.data[0].id
|
||||
|
||||
responses = client.embeddings.create(input=[
|
||||
"Hello my name is",
|
||||
"The best thing about vLLM is that it supports many different models"
|
||||
],
|
||||
model=model)
|
||||
responses = client.embeddings.create(
|
||||
input=[
|
||||
"Hello my name is",
|
||||
"The best thing about vLLM is that it supports many different models"
|
||||
],
|
||||
model=model,
|
||||
encoding_format="float",
|
||||
)
|
||||
|
||||
for data in responses.data:
|
||||
print(data.embedding) # list of float of len 4096
|
||||
|
||||
Reference in New Issue
Block a user