add qwen3
This commit is contained in:
17
vllm-v0.6.2/examples/offline_inference_embedding.py
Normal file
17
vllm-v0.6.2/examples/offline_inference_embedding.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from vllm import LLM
|
||||
|
||||
# Sample prompts.
|
||||
prompts = [
|
||||
"Hello, my name is",
|
||||
"The president of the United States is",
|
||||
"The capital of France is",
|
||||
"The future of AI is",
|
||||
]
|
||||
|
||||
# Create an LLM.
|
||||
model = LLM(model="intfloat/e5-mistral-7b-instruct", enforce_eager=True)
|
||||
# Generate embedding. The output is a list of EmbeddingRequestOutputs.
|
||||
outputs = model.encode(prompts)
|
||||
# Print the outputs.
|
||||
for output in outputs:
|
||||
print(output.outputs.embedding) # list of 4096 floats
|
||||
Reference in New Issue
Block a user