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

**URL:** <https://discuss.vllm.ai/t/model-embed-return-valueerror-too-many-values-to-unpack-expected-1/483>\
**Category:** General\
**Created:** [April 17, 2025, 3:58pm UTC](https://discuss.vllm.ai/t/model-embed-return-valueerror-too-many-values-to-unpack-expected-1/483 "2025-04-17T15:58:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aek](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@aek](https://discuss.vllm.ai/u/aek)\
**Post date:** [April 17, 2025, 3:58pm UTC](https://discuss.vllm.ai/t/model-embed-return-valueerror-too-many-values-to-unpack-expected-1/483/1 "2025-04-17T15:58:43Z")

</div>

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)})")

---

<div class="post-metadata">

**Author:** ![DarkLight1337](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/darklight1337/32/570_2.png) [@DarkLight1337](https://discuss.vllm.ai/u/DarkLight1337)\
**Post date:** [April 17, 2025, 4:04pm UTC](https://discuss.vllm.ai/t/model-embed-return-valueerror-too-many-values-to-unpack-expected-1/483/2 "2025-04-17T16:04:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aek](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@aek](https://discuss.vllm.ai/u/aek)\
**Post date:** [April 17, 2025, 5:27pm UTC](https://discuss.vllm.ai/t/model-embed-return-valueerror-too-many-values-to-unpack-expected-1/483/3 "2025-04-17T17:27:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aek](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@aek](https://discuss.vllm.ai/u/aek)\
**Post date:** [April 18, 2025, 12:32pm UTC](https://discuss.vllm.ai/t/model-embed-return-valueerror-too-many-values-to-unpack-expected-1/483/4 "2025-04-18T12:32:28Z")

</div>

DarkLight1337, Thanks for help.
