mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-10 04:20:44 +02:00
refac
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user