mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-06 18:49:40 +00:00
added possibility to add tokenizer via plugin and refactored earlier changes
This commit is contained in:
1 parent
95fb213069
commit
aa554d4a53
15 files changed
+306
-41
No files matched your search
@@ -163,13 +163,11 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
// Load the used instance names:
|
||||
this.UsedInstanceNames = this.SettingsManager.ConfigurationData.EmbeddingProviders.Select(x => x.Name.ToLowerInvariant()).ToList();
|
||||
|
||||
Console.WriteLine($"Previous instance names: {this.dataEditingPreviousInstanceName}");
|
||||
// When editing, we need to load the data:
|
||||
if(this.IsEditing)
|
||||
{
|
||||
this.dataEditingPreviousInstanceName = this.DataName.ToLowerInvariant();
|
||||
this.dataFilePath = this.DataTokenizerPath;
|
||||
Console.WriteLine($"Previous instance name is '{this.dataEditingPreviousInstanceName}'");
|
||||
|
||||
// When using self-hosted embedding, we must copy the model name:
|
||||
if (this.DataLLMProvider is LLMProviders.SELF_HOSTED)
|
||||
@@ -243,8 +241,7 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
if (!this.dataIsValid)
|
||||
return;
|
||||
|
||||
var response = await this.RustService.StoreTokenizer("embedding_"+this.DataName, "embedding_"+this.dataEditingPreviousInstanceName, this.dataFilePath);
|
||||
Console.WriteLine($"Response from Rust: {response.Message}");
|
||||
var response = await this.RustService.StoreTokenizer(TokenizerModelId.ForEmbeddingProviderId(this.DataId), this.dataFilePath);
|
||||
if (!response.Success)
|
||||
{
|
||||
this.dataCustomTokenizerValidationIssue = response.Message;
|
||||
|
||||
@@ -268,7 +268,7 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
|
||||
if (!this.dataIsValid)
|
||||
return;
|
||||
|
||||
var tokenizerResponse = await this.RustService.StoreTokenizer("chat_"+this.DataInstanceName, "chat_"+this.dataEditingPreviousInstanceName, this.dataFilePath);
|
||||
var tokenizerResponse = await this.RustService.StoreTokenizer(TokenizerModelId.ForProviderId(this.DataId), this.dataFilePath);
|
||||
if (!tokenizerResponse.Success)
|
||||
{
|
||||
this.dataCustomTokenizerValidationIssue = tokenizerResponse.Message;
|
||||
|
||||
Reference in new issue
Block a user