feat(pi): add vision model support
Extract a shared hasType helper for model filtering and add vision (text + image) input capability to compatible models. Also tag two llama-swap models with the vision type.
This commit is contained in:
@@ -13,9 +13,9 @@ in
|
|||||||
toPiModels =
|
toPiModels =
|
||||||
llamaSwapConfig:
|
llamaSwapConfig:
|
||||||
let
|
let
|
||||||
textGenModels = filterAttrs (name: model: any (t: t == "coding") (model.metadata.type or [ ])) (
|
hasType = type: model: any (t: t == type) (model.metadata.type or [ ]);
|
||||||
llamaSwapConfig.models or { }
|
|
||||||
);
|
codingModels = filterAttrs (_name: model: hasType "coding" model) (llamaSwapConfig.models or { });
|
||||||
|
|
||||||
localModels = mapAttrs
|
localModels = mapAttrs
|
||||||
(
|
(
|
||||||
@@ -32,8 +32,19 @@ in
|
|||||||
else
|
else
|
||||||
{ }
|
{ }
|
||||||
)
|
)
|
||||||
|
// (
|
||||||
|
if hasType "vision" model then
|
||||||
|
{
|
||||||
|
input = [
|
||||||
|
"text"
|
||||||
|
"image"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ }
|
||||||
|
)
|
||||||
)
|
)
|
||||||
textGenModels;
|
codingModels;
|
||||||
|
|
||||||
peerModels = listToAttrs (
|
peerModels = listToAttrs (
|
||||||
flatten (
|
flatten (
|
||||||
|
|||||||
@@ -335,7 +335,10 @@ in
|
|||||||
-dev CUDA1
|
-dev CUDA1
|
||||||
'';
|
'';
|
||||||
metadata = {
|
metadata = {
|
||||||
type = [ "text-generation" ];
|
type = [
|
||||||
|
"text-generation"
|
||||||
|
"vision"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -612,6 +615,7 @@ in
|
|||||||
type = [
|
type = [
|
||||||
"text-generation"
|
"text-generation"
|
||||||
"coding"
|
"coding"
|
||||||
|
"vision"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user