mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #19749] issue: Embedding model not working (“NoneType has no attribute encode”) when using local SentenceTransformers (engine="") #57648
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tar-s on GitHub (Dec 4, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/19749
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.39
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When using the default local embedding engine (
embedding_engine="") with a SentenceTransformers model such as BAAI/bge-m3, OpenWebUI should:SentenceTransformer(embedding_model)).embedding_functionobject with an.encode()method.NoneTypeerrors.Local embeddings should work reliably without requiring Ollama/OpenAI engines.
Actual Behavior
OpenWebUI fails to generate embeddings using the default local embedding engine.
Backend logs:
This indicates that
embedding_functionis never initialized and remainsNone, causing embedding generation to fail for any document ingestion.Steps to Reproduce
Steps to Reproduce
Start OpenWebUI using the latest Docker image:
Go to Settings → Embeddings.
Configure:
(
embedding_engine="")BAAI/bge-m3Upload any document (PDF, PPTX, DOCX).
Observe backend logs — embedding generation fails with:
Logs & Screenshots
Relevant Logs
Additional fragment:
This confirms
embedding_functionisNone.Additional Information
Root Cause (identified)
In
retrieval/utils.py, the code path forembedding_engine == ""defines an async wrapper aroundembedding_function.encode, but never initializesembedding_function:Problems:
embedding_functionis never created for the default engine.Verification inside the container
Manual test succeeds:
CUDA and Torch work as expected.
Proposed Fix
Add initialization for the default embedding engine:
Then wrap it in the async function.
This aligns with previous versions of OpenWebUI where SentenceTransformers embeddings worked correctly.
@owui-terminator[bot] commented on GitHub (Dec 4, 2025):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#17005 issue: 'NoneType' object has no attribute 'encode'
by zic04 • Aug 28, 2025 •
bug#19474 issue: Embeddings using API not working
by curious-broccoli • Nov 25, 2025 •
bug#19512 issue: Regression: 'NoneType' object has no attribute 'encode' with SentenceTransformers embedding Qwen/Qwen3-Embedding-0.6B in v0.6.40 (works in v0.6.38)
by borntoknow • Nov 26, 2025 •
bug#14433 issue: WebSearch does not work - 'NoneType' object has no attribute 'encode'
by yazon • May 28, 2025 •
bug#13630 issue: Notes broken because of embeddings exception: TypeError: 'NoneType' object is not iterable
by thiswillbeyourgithub • May 07, 2025 •
bugShow 5 more related issues
#16389 issue: embeddings based on OpenAI-compatible APIs are broken
by MattBash17 • Aug 08, 2025 •
bug#17605 issue: non_ASCII UTF-8 always encoded in payload sent to model (leading to bad tokenization)
by mramendi • Sep 19, 2025 •
bug#15535 issue: Plain text file upload to knowledge fails with 400: 'NoneType' object has no attribute 'encode'
by GanizaniSitara • Jul 04, 2025 •
bug#11224 issue: Embedding model set: sentence-transformers/all-MiniLM-L6-v2 THEN exited with code 0 (DOCKER)
by toddpage • Mar 05, 2025 •
bug#19423 issue: Embedding regression
by scheatkode • Nov 24, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@Classic298 commented on GitHub (Dec 4, 2025):
setup details? Did you enter the model in the Document settings AND press the download button AND press on save? Did you enable offline mode of hf hub offline per any chance?