Model.embed return "ValueError: too many values to unpack (expected 1)"

This is the code from the example. But it returns an error “ValueError: too many values to unpack (expected 1)”. Why?
Code:
from vllm import LLM
llm = LLM(model=“intfloat/e5-mistral-7b-instruct”, task=“embed”)
prompts = [
“Hello, my name is”,
“The president of the United States is”,
“The capital of France is”,
“The future of AI is”,
]

(output,) = llm.embed(prompts)

embeds = output.outputs.embedding
print(f"Embeddings: {embeds!r} (size={len(embeds)})")

llm.embed outputs one result per prompt. You inputted 4 prompts so there should be 4 outputs

  • A little explanation: the error “ValueError: too many values to unpack (expected 1)” is given by the code “llm.embed(prompts)”.

DarkLight1337, Thanks for help.