mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
refac
This commit is contained in:
parent
9e3e24e304
commit
55ca719bbf
1 changed files with 6 additions and 0 deletions
|
|
@ -926,6 +926,12 @@ def get_embedding_function(
|
|||
concurrent_requests=0,
|
||||
) -> Awaitable:
|
||||
if embedding_engine == '':
|
||||
if embedding_function is None:
|
||||
raise ValueError(
|
||||
'No embedding model is loaded. Set RAG_EMBEDDING_MODEL to a valid '
|
||||
'SentenceTransformer model name, or configure an external '
|
||||
'RAG_EMBEDDING_ENGINE (ollama, openai, azure_openai).'
|
||||
)
|
||||
# Sentence transformers: CPU-bound sync operation
|
||||
async def async_embedding_function(query, prefix=None, user=None):
|
||||
return await asyncio.to_thread(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue