mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 00:19:48 +00:00
Improved model selection in provider dialog
This commit is contained in:
parent
cca3dd4989
commit
1f1512898d
@ -73,33 +73,49 @@
|
|||||||
<MudJustifiedText Class="mb-3"> Please double-check if your model name matches the curl specifications provided by the inference provider. If it doesn't, you might get a <b>Not Found</b> error when trying to use the model. Here's a <MudLink Href="https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct?inference_api=true&inference_provider=novita&language=sh" Target="_blank">curl example</MudLink>.</MudJustifiedText>
|
<MudJustifiedText Class="mb-3"> Please double-check if your model name matches the curl specifications provided by the inference provider. If it doesn't, you might get a <b>Not Found</b> error when trying to use the model. Here's a <MudLink Href="https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct?inference_api=true&inference_provider=novita&language=sh" Target="_blank">curl example</MudLink>.</MudJustifiedText>
|
||||||
}
|
}
|
||||||
|
|
||||||
<MudStack Row="@true" AlignItems="AlignItems.Center">
|
<MudField FullWidth="true" Label="Model selection" Variant="Variant.Outlined" Class="mb-3">
|
||||||
@if (this.DataLLMProvider.IsLLMModelProvidedManually())
|
<MudStack Row="@true" AlignItems="AlignItems.Baseline" StretchItems="StretchItems.End">
|
||||||
{
|
@if (this.DataLLMProvider.IsLLMModelProvidedManually())
|
||||||
<MudButton Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.GetModelsOverviewURL(this.HFInferenceProviderId)" Target="_blank">Show available models</MudButton>
|
{
|
||||||
<MudTextField
|
<MudButton Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.GetModelsOverviewURL(this.HFInferenceProviderId)" Target="_blank">
|
||||||
T="string"
|
Show available models
|
||||||
@bind-Text="@this.dataManuallyModel"
|
</MudButton>
|
||||||
Label="Model"
|
<MudTextField
|
||||||
Class="mb-3"
|
T="string"
|
||||||
Adornment="Adornment.Start"
|
@bind-Text="@this.dataManuallyModel"
|
||||||
AdornmentIcon="@Icons.Material.Filled.FaceRetouchingNatural"
|
Label="Model"
|
||||||
AdornmentColor="Color.Info"
|
Adornment="Adornment.Start"
|
||||||
Validation="@this.ValidateManuallyModel"
|
AdornmentIcon="@Icons.Material.Filled.FaceRetouchingNatural"
|
||||||
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
AdornmentColor="Color.Info"
|
||||||
/>
|
Validation="@this.ValidateManuallyModel"
|
||||||
}
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
||||||
else
|
/>
|
||||||
{
|
}
|
||||||
<MudButton Disabled="@(!this.DataLLMProvider.CanLoadModels(this.DataHost, this.dataAPIKey))" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.Refresh" OnClick="this.ReloadModels">Load</MudButton>
|
else
|
||||||
<MudSelect Disabled="@this.IsNoneProvider" @bind-Value="@this.DataModel" Label="Model" Class="mb-3" OpenIcon="@Icons.Material.Filled.FaceRetouchingNatural" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingModel">
|
{
|
||||||
@foreach (var model in this.availableModels)
|
<MudButton Disabled="@(!this.DataLLMProvider.CanLoadModels(this.DataHost, this.dataAPIKey))" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.Refresh" OnClick="this.ReloadModels">
|
||||||
|
Load models
|
||||||
|
</MudButton>
|
||||||
|
@if(this.availableModels.Count is 0)
|
||||||
{
|
{
|
||||||
<MudSelectItem Value="@model">@model</MudSelectItem>
|
<MudText Typo="Typo.body1">
|
||||||
|
No models loaded or available.
|
||||||
|
</MudText>
|
||||||
}
|
}
|
||||||
</MudSelect>
|
else
|
||||||
}
|
{
|
||||||
</MudStack>
|
<MudSelect @bind-Value="@this.DataModel"
|
||||||
|
OpenIcon="@Icons.Material.Filled.FaceRetouchingNatural" AdornmentColor="Color.Info"
|
||||||
|
Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingModel">
|
||||||
|
@foreach (var model in this.availableModels)
|
||||||
|
{
|
||||||
|
<MudSelectItem Value="@model">@model</MudSelectItem>
|
||||||
|
}
|
||||||
|
</MudSelect>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</MudStack>
|
||||||
|
</MudField>
|
||||||
|
|
||||||
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
||||||
<MudTextField
|
<MudTextField
|
||||||
|
@ -272,6 +272,4 @@ public partial class ProviderDialog : ComponentBase, ISecretId
|
|||||||
LLMProviders.SELF_HOSTED => "(Optional) API Key",
|
LLMProviders.SELF_HOSTED => "(Optional) API Key",
|
||||||
_ => "API Key",
|
_ => "API Key",
|
||||||
};
|
};
|
||||||
|
|
||||||
private bool IsNoneProvider => this.DataLLMProvider is LLMProviders.NONE;
|
|
||||||
}
|
}
|
@ -3,4 +3,5 @@
|
|||||||
- Changed the terminology from "temporary chats" to "disappearing chats" in the UI. This makes it clearer to understand the purpose of these chats.
|
- Changed the terminology from "temporary chats" to "disappearing chats" in the UI. This makes it clearer to understand the purpose of these chats.
|
||||||
- Improved the hot reloading of the plugin system to prevent overlapping reloads.
|
- Improved the hot reloading of the plugin system to prevent overlapping reloads.
|
||||||
- Improved the app behavior when the user system was waked up from sleep mode.
|
- Improved the app behavior when the user system was waked up from sleep mode.
|
||||||
|
- Improved the model selection on the provider dialog.
|
||||||
- Fixed the color for the update notification button to match the color theme.
|
- Fixed the color for the update notification button to match the color theme.
|
Loading…
Reference in New Issue
Block a user