File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 53
53
},
54
54
"ai-lab.inferenceRuntime" : {
55
55
"type" : " string" ,
56
- "default" : " llama-cpp" ,
57
56
"enum" : [
58
57
" llama-cpp" ,
59
- " whisper-cpp " ,
60
- " none "
58
+ " openvino " ,
59
+ " vllm "
61
60
],
62
61
"description" : " Choose the default inferencing runtime for AI Lab"
63
62
},
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ function handleOnChange(nValue: (ModelInfo & { label: string; value: string }) |
47
47
value = nValue ;
48
48
}
49
49
50
- let defaultRuntime: string = ' llama-cpp ' ;
50
+ let defaultRuntime: string | undefined = $state () ;
51
51
52
52
onMount (() => {
53
53
return configuration .subscribe (values => {
@@ -56,6 +56,13 @@ onMount(() => {
56
56
}
57
57
});
58
58
});
59
+
60
+ function filterModel(model : ModelInfo ): boolean {
61
+ // If the defaultRuntime is undefined we should not filter any model
62
+ if (! defaultRuntime ) return true ;
63
+
64
+ return model .backend === defaultRuntime ;
65
+ }
59
66
</script >
60
67
61
68
<Select
@@ -66,7 +73,7 @@ onMount(() => {
66
73
onchange ={handleOnChange }
67
74
placeholder =" Select model to use"
68
75
items ={models
69
- .filter (model => model . backend === defaultRuntime )
76
+ .filter (filterModel )
70
77
.toSorted ((a , b ) => getModelSortingScore (a ) - getModelSortingScore (b ))
71
78
.map (model => ({ ... model , value: model .id , label: model .name }))}>
72
79
<div slot =" item" let:item >
Original file line number Diff line number Diff line change @@ -103,12 +103,12 @@ function openContribution(): void {
103
103
studioClient .openURL (' https://github.com/containers/ai-lab-recipes/blob/main/CONTRIBUTING.md' ).catch (console .error );
104
104
}
105
105
106
- let defaultRuntime: string = $state (' llama-cpp ' );
106
+ let defaultRuntime: string | undefined = $state ();
107
107
108
108
onMount (() => {
109
109
const inferenceRuntime = $configuration ?.inferenceRuntime ;
110
110
if (inferenceRuntime ) defaultRuntime = inferenceRuntime ;
111
- onFilterChange (' tools' , defaultRuntime );
111
+ onFilterChange (' tools' , defaultRuntime ?? ' all ' );
112
112
});
113
113
</script >
114
114
You can’t perform that action at this time.
0 commit comments