Skip to content

Commit a9493fa

Browse files
committed
feat: reorder model families
1 parent a1e3a21 commit a9493fa

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

app/components/model-select.tsx

+16-19
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,6 @@ const ModelSelect: React.FC<ModelSearchProps> = ({
207207
return counts;
208208
};
209209

210-
const modelCounts = countModelsPerFamily(availableModels);
211-
const sortedModelFamilies = Object.entries(modelFamilies).sort(
212-
([a], [b]) => (modelCounts[b] || 0) - (modelCounts[a] || 0),
213-
);
214-
215210
return (
216211
<div className="screen-model-container">
217212
<Modal title={Locale.ModelSelect.Title} onClose={onClose}>
@@ -222,20 +217,22 @@ const ModelSelect: React.FC<ModelSearchProps> = ({
222217
inputRef={searchInputRef}
223218
/>
224219
<div className={style["model-family-filter"]}>
225-
{sortedModelFamilies.map(([key, { name, icon: Icon }]) => (
226-
<IconButton
227-
key={key}
228-
onClick={() => handleToggleFamilyFilter(key)}
229-
bordered
230-
text={name}
231-
icon={
232-
<div className={style["icon"]}>
233-
{Icon ? <Icon /> : <Cpu />}
234-
</div>
235-
}
236-
className={`${style["model-family-button"]}${selectedFamilies.includes(key) ? " " + style["selected-model-family"] : ""}`}
237-
/>
238-
))}
220+
{Object.entries(modelFamilies).map(
221+
([key, { name, icon: Icon }]) => (
222+
<IconButton
223+
key={key}
224+
onClick={() => handleToggleFamilyFilter(key)}
225+
bordered
226+
text={name}
227+
icon={
228+
<div className={style["icon"]}>
229+
{Icon ? <Icon /> : <Cpu />}
230+
</div>
231+
}
232+
className={`${style["model-family-button"]}${selectedFamilies.includes(key) ? " " + style["selected-model-family"] : ""}`}
233+
/>
234+
),
235+
)}
239236
</div>
240237
</div>
241238
<div className={style["model-list"]}>

app/utils/model.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,20 @@ export interface ModelDetails {
7373
export const modelDetailsList: ModelDetails[] = [
7474
{ family: ModelFamily.LLAMA, name: "Llama", icon: MetaIcon },
7575
{ family: ModelFamily.DEEPSEEK, name: "DeepSeek", icon: DeepSeekIcon },
76-
{ family: ModelFamily.PHI, name: "Phi", icon: MicrosoftIcon },
77-
{ family: ModelFamily.MISTRAL, name: "Mistral", icon: MistralIcon },
78-
{ family: ModelFamily.GEMMA, name: "Gemma", icon: GoogleIcon },
7976
{
8077
family: ModelFamily.QWEN,
8178
name: "Qwen",
8279
icon: (...props) => <img src="./qwen.webp" alt="Qwen Logo" {...props} />,
8380
},
81+
{ family: ModelFamily.GEMMA, name: "Gemma", icon: GoogleIcon },
82+
{ family: ModelFamily.PHI, name: "Phi", icon: MicrosoftIcon },
83+
{ family: ModelFamily.MISTRAL, name: "Mistral", icon: MistralIcon },
8484
{
8585
family: ModelFamily.SMOL_LM,
8686
name: "SmolLM",
8787
icon: (...props) => <img src="./smollm.png" alt="SmolLM Logo" {...props} />,
8888
},
89-
{ family: ModelFamily.WIZARD_MATH, name: "Wizard Math", icon: WandSparkles },
9089
{ family: ModelFamily.STABLE_LM, name: "StableLM", icon: StablelmIcon },
9190
{ family: ModelFamily.REDPAJAMA, name: "RedPajama", icon: Shirt },
91+
{ family: ModelFamily.WIZARD_MATH, name: "Wizard Math", icon: WandSparkles },
9292
];

0 commit comments

Comments
 (0)