mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-07 22:09: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
@@ -1259,12 +1259,12 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
var response = await this.RustService.GetTokenCount(this.Provider.InstanceName, this.Provider.TokenizerPath, this.inputField.Value);
|
||||
var response = await this.RustService.GetTokenCount(this.Provider, this.inputField.Value);
|
||||
if (response is null)
|
||||
return;
|
||||
if (!response.Value.Success)
|
||||
{
|
||||
this.Logger.LogWarning($"Failed to calculate token count: status='{response.Value.Status}', reason='{response.Value.Message}'");
|
||||
this.Logger.LogWarning("Failed to calculate token count: reason='{Reason}'", response.Value.Message);
|
||||
return;
|
||||
}
|
||||
this.tokenCount = response.Value.TokenCount.ToString();
|
||||
|
||||
Reference in new issue
Block a user