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 =
|
||||
llamaSwapConfig:
|
||||
let
|
||||
textGenModels = filterAttrs (name: model: any (t: t == "coding") (model.metadata.type or [ ])) (
|
||||
llamaSwapConfig.models or { }
|
||||
);
|
||||
hasType = type: model: any (t: t == type) (model.metadata.type or [ ]);
|
||||
|
||||
codingModels = filterAttrs (_name: model: hasType "coding" model) (llamaSwapConfig.models or { });
|
||||
|
||||
localModels = mapAttrs
|
||||
(
|
||||
@@ -32,8 +32,19 @@ in
|
||||
else
|
||||
{ }
|
||||
)
|
||||
// (
|
||||
if hasType "vision" model then
|
||||
{
|
||||
input = [
|
||||
"text"
|
||||
"image"
|
||||
];
|
||||
}
|
||||
else
|
||||
{ }
|
||||
)
|
||||
textGenModels;
|
||||
)
|
||||
codingModels;
|
||||
|
||||
peerModels = listToAttrs (
|
||||
flatten (
|
||||
|
||||
@@ -335,7 +335,10 @@ in
|
||||
-dev CUDA1
|
||||
'';
|
||||
metadata = {
|
||||
type = [ "text-generation" ];
|
||||
type = [
|
||||
"text-generation"
|
||||
"vision"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -612,6 +615,7 @@ in
|
||||
type = [
|
||||
"text-generation"
|
||||
"coding"
|
||||
"vision"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user