mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-13 17:33:47 +00:00
made the chunking process more robust
This commit is contained in:
1 parent
95ca74809b
commit
1bf9328fb9
9 files changed
+239
-37
No files matched your search
@@ -1121,16 +1121,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
var tokenizerResponse = await this.RustService.EnsureTokenizer(this.Provider.InstanceName, this.Provider.TokenizerPath);
|
||||
if (tokenizerResponse is null)
|
||||
return;
|
||||
if (!tokenizerResponse.Value.Success)
|
||||
{
|
||||
this.Logger.LogWarning($"Failed to initialize the tokenizer for the provider: status='{tokenizerResponse.Value.Status}', reason='{tokenizerResponse.Value.Message}'");
|
||||
return;
|
||||
}
|
||||
|
||||
var response = await this.RustService.GetTokenCount(this.inputField.Value);
|
||||
var response = await this.RustService.GetTokenCount(this.Provider.InstanceName, this.Provider.TokenizerPath, this.inputField.Value);
|
||||
if (response is null)
|
||||
return;
|
||||
if (!response.Value.Success)
|
||||
@@ -1224,4 +1215,4 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user