mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-10 12:35:55 +02:00
refac
This commit is contained in:
@@ -926,6 +926,12 @@ def get_embedding_function(
|
|||||||
concurrent_requests=0,
|
concurrent_requests=0,
|
||||||
) -> Awaitable:
|
) -> Awaitable:
|
||||||
if embedding_engine == '':
|
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
|
# Sentence transformers: CPU-bound sync operation
|
||||||
async def async_embedding_function(query, prefix=None, user=None):
|
async def async_embedding_function(query, prefix=None, user=None):
|
||||||
return await asyncio.to_thread(
|
return await asyncio.to_thread(
|
||||||
|
|||||||
Reference in New Issue
Block a user