Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
316a41ac
Unverified
Commit
316a41ac
authored
Jul 24, 2024
by
Chang Su
Committed by
GitHub
Jul 24, 2024
Browse files
[Bugfix] Fix encoding_format in examples/openai_embedding_client.py (#6755)
parent
0310029a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
examples/openai_embedding_client.py
examples/openai_embedding_client.py
+8
-5
tests/entrypoints/openai/test_embedding.py
tests/entrypoints/openai/test_embedding.py
+0
-1
No files found.
examples/openai_embedding_client.py
View file @
316a41ac
...
@@ -13,11 +13,14 @@ client = OpenAI(
...
@@ -13,11 +13,14 @@ client = OpenAI(
models
=
client
.
models
.
list
()
models
=
client
.
models
.
list
()
model
=
models
.
data
[
0
].
id
model
=
models
.
data
[
0
].
id
responses
=
client
.
embeddings
.
create
(
input
=
[
responses
=
client
.
embeddings
.
create
(
"Hello my name is"
,
input
=
[
"The best thing about vLLM is that it supports many different models"
"Hello my name is"
,
],
"The best thing about vLLM is that it supports many different models"
model
=
model
)
],
model
=
model
,
encoding_format
=
"float"
,
)
for
data
in
responses
.
data
:
for
data
in
responses
.
data
:
print
(
data
.
embedding
)
# list of float of len 4096
print
(
data
.
embedding
)
# list of float of len 4096
tests/entrypoints/openai/test_embedding.py
View file @
316a41ac
...
@@ -18,7 +18,6 @@ def embedding_server():
...
@@ -18,7 +18,6 @@ def embedding_server():
"--enforce-eager"
,
"--enforce-eager"
,
"--max-model-len"
,
"--max-model-len"
,
"8192"
,
"8192"
,
"--enforce-eager"
,
]
]
with
RemoteOpenAIServer
(
EMBEDDING_MODEL_NAME
,
args
)
as
remote_server
:
with
RemoteOpenAIServer
(
EMBEDDING_MODEL_NAME
,
args
)
as
remote_server
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment