Skip to content

Commit

Permalink
feat: reorder model families
Browse files Browse the repository at this point in the history
  • Loading branch information
Neet-Nestor committed Jan 21, 2025
1 parent a1e3a21 commit a9493fa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
35 changes: 16 additions & 19 deletions app/components/model-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,6 @@ const ModelSelect: React.FC<ModelSearchProps> = ({
return counts;
};

const modelCounts = countModelsPerFamily(availableModels);
const sortedModelFamilies = Object.entries(modelFamilies).sort(
([a], [b]) => (modelCounts[b] || 0) - (modelCounts[a] || 0),
);

return (
<div className="screen-model-container">
<Modal title={Locale.ModelSelect.Title} onClose={onClose}>
Expand All @@ -222,20 +217,22 @@ const ModelSelect: React.FC<ModelSearchProps> = ({
inputRef={searchInputRef}
/>
<div className={style["model-family-filter"]}>
{sortedModelFamilies.map(([key, { name, icon: Icon }]) => (
<IconButton
key={key}
onClick={() => handleToggleFamilyFilter(key)}
bordered
text={name}
icon={
<div className={style["icon"]}>
{Icon ? <Icon /> : <Cpu />}
</div>
}
className={`${style["model-family-button"]}${selectedFamilies.includes(key) ? " " + style["selected-model-family"] : ""}`}
/>
))}
{Object.entries(modelFamilies).map(
([key, { name, icon: Icon }]) => (
<IconButton
key={key}
onClick={() => handleToggleFamilyFilter(key)}
bordered
text={name}
icon={
<div className={style["icon"]}>
{Icon ? <Icon /> : <Cpu />}
</div>
}
className={`${style["model-family-button"]}${selectedFamilies.includes(key) ? " " + style["selected-model-family"] : ""}`}
/>
),
)}
</div>
</div>
<div className={style["model-list"]}>
Expand Down
8 changes: 4 additions & 4 deletions app/utils/model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,20 @@ export interface ModelDetails {
export const modelDetailsList: ModelDetails[] = [
{ family: ModelFamily.LLAMA, name: "Llama", icon: MetaIcon },
{ family: ModelFamily.DEEPSEEK, name: "DeepSeek", icon: DeepSeekIcon },
{ family: ModelFamily.PHI, name: "Phi", icon: MicrosoftIcon },
{ family: ModelFamily.MISTRAL, name: "Mistral", icon: MistralIcon },
{ family: ModelFamily.GEMMA, name: "Gemma", icon: GoogleIcon },
{
family: ModelFamily.QWEN,
name: "Qwen",
icon: (...props) => <img src="./qwen.webp" alt="Qwen Logo" {...props} />,
},
{ family: ModelFamily.GEMMA, name: "Gemma", icon: GoogleIcon },
{ family: ModelFamily.PHI, name: "Phi", icon: MicrosoftIcon },
{ family: ModelFamily.MISTRAL, name: "Mistral", icon: MistralIcon },
{
family: ModelFamily.SMOL_LM,
name: "SmolLM",
icon: (...props) => <img src="./smollm.png" alt="SmolLM Logo" {...props} />,
},
{ family: ModelFamily.WIZARD_MATH, name: "Wizard Math", icon: WandSparkles },
{ family: ModelFamily.STABLE_LM, name: "StableLM", icon: StablelmIcon },
{ family: ModelFamily.REDPAJAMA, name: "RedPajama", icon: Shirt },
{ family: ModelFamily.WIZARD_MATH, name: "Wizard Math", icon: WandSparkles },
];

0 comments on commit a9493fa

Please sign in to comment.