Repository: langchain
Issue: TypeError: 'float' object is not iterable in embed_query method in LlamaCppEmbeddings in version: 0.3.14 work just fine on 0.3.13
Labels: 🤖:bug

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.
- [X] I am sure that this is a bug in LangChain rather than my code.
- [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

### Example Code

       from langchain_community.embeddings import LlamaCppEmbeddings
       my_embedder = "./nomic-embed-text-v1.5.f16.gguf"
       llm_emb=LlamaCppEmbeddings(
            model_path=my_embedder,
            n_gpu_layers=10,
            n_batch=300,
            )
        dim = len(llm_emb.embed_query("hello world"))

### Error Message and Stack Trace (if applicable)

    result = func()
             ^^^^^^
  File "/home/pk/Mashroom_rag/langchain/env/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
    exec(code, module.__dict__)
  File "/home/pk/Mashroom_rag/langchain/ui.py", line 75, in <module>
    page()
  File "/home/pk/Mashroom_rag/langchain/ui.py", line 54, in page
    st.session_state["assistant"] = ChatPDF()
                                    ^^^^^^^^^
  File "/home/pk/Mashroom_rag/langchain/loed.py", line 215, in __init__
    dim = len(llm_emb.embed_query("hello world"))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pk/Mashroom_rag/langchain/env/lib/python3.12/site-packages/langchain_community/embeddings/llamacpp.py", line 145, in embed_query
    return list(map(float, embedding[0]))
                ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object is not iterable


### Description

My code works perfectly fine on version 0.3.13 but doesn't on the latest 0.3.14 I expect it's from this commit [#41b6a86 ](https://github.com/langchain-ai/langchain/commit/41b6a86bbe030291cf8ee284ed0cd70dd493152b)


### System Info

aiohappyeyeballs==2.4.4
aiohttp==3.11.11
aiosignal==1.3.2
altair==5.5.0
annotated-types==0.7.0
anyio==4.8.0
asttokens==3.0.0
attrs==24.3.0
backcall==0.2.0
beautifulsoup4==4.12.3
bleach==6.2.0
blinker==1.9.0
cachetools==5.5.0
certifi==2024.12.14
charset-normalizer==3.4.1
click==8.1.8
dataclasses-json==0.6.7
decorator==5.1.1
defusedxml==0.7.1
diskcache==5.6.3
docopt==0.6.2
executing==2.1.0
faiss-gpu-cu12==1.9.0.post1
fastjsonschema==2.21.1
frozenlist==1.5.0
gitdb==4.0.12
GitPython==3.1.44
greenlet==3.1.1
h11==0.14.0
httpcore==1.0.7
httpx==0.28.1
httpx-sse==0.4.0
idna==3.10
ipython==8.12.3
jedi==0.19.2
Jinja2==3.1.5
jsonpatch==1.33
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyterlab_pygments==0.3.0
langchain==0.3.14
langchain-community==0.3.14
langchain-core==0.3.29
langchain-text-splitters==0.3.5
langgraph==0.2.62
langgraph-checkpoint==2.0.9
langgraph-sdk==0.1.51
langsmith==0.2.10
llama_cpp_python==0.3.5
markdown-it-py==3.0.0
MarkupSafe==3.0.2
marshmallow==3.25.1
matplotlib-inline==0.1.7
mdurl==0.1.2
mistune==3.1.0
msgpack==1.1.0
multidict==6.1.0
mypy-extensions==1.0.0
narwhals==1.21.1
nbclient==0.10.2
nbconvert==7.16.5
nbformat==5.10.4
numpy==1.26.4
nvidia-cublas-cu12==12.6.4.1
nvidia-cuda-runtime-cu12==12.6.77
orjson==3.10.14
packaging==24.2
pandas==2.2.3
pandocfilters==1.5.1
parso==0.8.4
pexpect==4.9.0
pickleshare==0.7.5
pillow==11.1.0
platformdirs==4.3.6
prompt_toolkit==3.0.48
propcache==0.2.1
protobuf==5.29.3
ptyprocess==0.7.0
pure_eval==0.2.3
pyarrow==18.1.0
pydantic==2.10.5
pydantic-settings==2.7.1
pydantic_core==2.27.2
pydeck==0.9.1
Pygments==2.19.1
pypdf==5.1.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytz==2024.2
PyYAML==6.0.2
pyzmq==26.2.0
referencing==0.35.1
requests==2.32.3
requests-toolbelt==1.0.0
rich==13.9.4
rpds-py==0.22.3
six==1.17.0
smmap==5.0.2
sniffio==1.3.1
soupsieve==2.6
SQLAlchemy==2.0.37
stack-data==0.6.3
streamlit==1.41.1
tenacity==9.0.0
tinycss2==1.4.0
toml==0.10.2
tornado==6.4.2
traitlets==5.14.3
typing-inspect==0.9.0
typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.3.0
watchdog==6.0.0
wcwidth==0.2.13
webencodings==0.5.1
yarg==0.1.9
yarl==1.18.3