File tree Expand file tree Collapse file tree 4 files changed +42
-4
lines changed
extensions/llamacpp-extension/src Expand file tree Collapse file tree 4 files changed +42
-4
lines changed Original file line number Diff line number Diff line change @@ -1270,7 +1270,7 @@ export default class llamacpp_extension extends AIEngine {
12701270 // who knows what they are doing.
12711271 // Takes a regex with matching tensor name as input
12721272 if ( cfg . override_tensor_buffer_t )
1273- args . push ( '--override-tensors ' , cfg . override_tensor_buffer_t )
1273+ args . push ( '--override-tensor ' , cfg . override_tensor_buffer_t )
12741274 args . push ( '-a' , modelId )
12751275 args . push ( '--port' , String ( port ) )
12761276 if ( modelConfig . mmproj_path ) {
Original file line number Diff line number Diff line change @@ -106,8 +106,10 @@ export function ModelSetting({
106106 < div key = { key } className = "space-y-2" >
107107 < div
108108 className = { cn (
109- 'flex items-start justify-between gap-8' ,
110- key === 'chat_template' && 'flex-col gap-1'
109+ 'flex items-start justify-between gap-8 last:mb-2' ,
110+ ( key === 'chat_template' ||
111+ key === 'override_tensor_buffer_t' ) &&
112+ 'flex-col gap-1 w-full'
111113 ) }
112114 >
113115 < div className = "space-y-1 mb-2" >
Original file line number Diff line number Diff line change @@ -276,9 +276,34 @@ export const useModelProvider = create<ModelProviderState>()(
276276 } )
277277 }
278278
279+ // Migration for override_tensor_buffer_type key (version 2 -> 3)
280+ if ( version === 2 && state ?. providers ) {
281+ state . providers . forEach ( ( provider ) => {
282+ if ( provider . models ) {
283+ provider . models . forEach ( ( model ) => {
284+ // Initialize settings if it doesn't exist
285+ if ( ! model . settings ) {
286+ model . settings = { }
287+ }
288+
289+ // Add missing override_tensor_buffer_type setting if it doesn't exist
290+ if ( ! model . settings . override_tensor_buffer_t ) {
291+ model . settings . override_tensor_buffer_t = {
292+ ...modelSettings . override_tensor_buffer_t ,
293+ controller_props : {
294+ ...modelSettings . override_tensor_buffer_t
295+ . controller_props ,
296+ } ,
297+ }
298+ }
299+ } )
300+ }
301+ } )
302+ }
303+
279304 return state
280305 } ,
281- version : 2 ,
306+ version : 3 ,
282307 }
283308 )
284309)
Original file line number Diff line number Diff line change @@ -133,4 +133,15 @@ export const modelSettings = {
133133 textAlign : 'right' ,
134134 } ,
135135 } ,
136+ override_tensor_buffer_t : {
137+ key : 'override_tensor_buffer_t' ,
138+ title : 'Override Tensor Buffer Type' ,
139+ description : 'Override the tensor buffer type for the model' ,
140+ controller_type : 'input' ,
141+ controller_props : {
142+ value : '' ,
143+ placeholder : 'e.g., layers\\.\\d+\\.ffn_.*=CPU' ,
144+ type : 'text' ,
145+ } ,
146+ } ,
136147}
You can’t perform that action at this time.
0 commit comments