Skip to content

Commit 1687bac

Browse files
committed
Keep workflow model selection flexible
1 parent 572c1bd commit 1687bac

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

StabilityMatrix.Avalonia/Controls/Inference/ModelCard.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<controls:Card Padding="12">
4444
<StackPanel Spacing="0">
4545
<!-- Model Row -->
46-
<Grid ColumnDefinitions="60,*,Auto">
46+
<Grid ColumnDefinitions="90,*,Auto">
4747
<TextBlock
4848
Grid.Column="0"
4949
VerticalAlignment="Center"

StabilityMatrix.Avalonia/ViewModels/Inference/ModelCardViewModel.cs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -724,22 +724,17 @@ private IReadOnlyList<HybridModelFile> GetWorkflowFilteredModels()
724724
if (SelectedWorkflowProfile is InferenceWorkflowProfile.Auto or InferenceWorkflowProfile.Custom)
725725
return allModels;
726726

727-
var filteredModels = allModels
727+
var compatibleModels = allModels
728728
.Where(model => IsModelCompatibleWithWorkflow(model, SelectedWorkflowProfile))
729-
.ToList();
729+
.ToHashSet(HybridModelFile.Comparer);
730730

731-
if (filteredModels.Count == 0)
731+
if (compatibleModels.Count == 0)
732732
return allModels;
733733

734-
if (
735-
SelectedUnifiedModel is { } selected
736-
&& filteredModels.All(model => !HybridModelFile.Comparer.Equals(model, selected))
737-
)
738-
{
739-
filteredModels.Insert(0, selected);
740-
}
741-
742-
return filteredModels;
734+
return allModels
735+
.OrderBy(model => compatibleModels.Contains(model) ? 0 : 1)
736+
.ThenBy(model => model.ShortDisplayName, StringComparer.OrdinalIgnoreCase)
737+
.ToList();
743738
}
744739

745740
private static bool IsModelCompatibleWithWorkflow(HybridModelFile model, InferenceWorkflowProfile profile)

0 commit comments

Comments
 (0)