mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-05 04:49:40 +00:00
made tokenizer concurrent and threadsafe
This commit is contained in:
1 parent
6985678d2f
commit
c8c1e38475
11 files changed
+110
-306
No files matched your search
@@ -6,7 +6,6 @@ using AIStudio.Tools.Databases;
|
||||
using AIStudio.Tools.Databases.EmbeddingState;
|
||||
using AIStudio.Tools.Databases.VectorStore;
|
||||
using AIStudio.Tools.RAG;
|
||||
using AIStudio.Tools.Rust;
|
||||
|
||||
namespace AIStudio.Tools.Services;
|
||||
|
||||
@@ -160,12 +159,8 @@ public sealed class DataSourceLocalRetrievalService(
|
||||
return false;
|
||||
}
|
||||
|
||||
var tokenCountResponse = await rustService.GetTokenCount(
|
||||
embeddingProvider.Name,
|
||||
embeddingProvider.TokenizerPath,
|
||||
query,
|
||||
token);
|
||||
if (tokenCountResponse is not { Success: true, Status: TokenizerStatus.AVAILABLE })
|
||||
var tokenCountResponse = await rustService.GetTokenCount(embeddingProvider, query, token);
|
||||
if (tokenCountResponse is not { Success: true })
|
||||
{
|
||||
logger.LogWarning(
|
||||
"Skipping vector retrieval for data source '{DataSourceName}' ({DataSourceId}) because the token count for embedding provider '{EmbeddingProviderName}' could not be determined. Reason='{Reason}'.",
|
||||
|
||||
Reference in new issue
Block a user