mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-12-23 01:24:24 +00:00
Change FlashAttn field type to string in LlamaServerOptions
This commit is contained in:
@@ -41,7 +41,7 @@ type LlamaServerOptions struct {
|
|||||||
BatchSize int `json:"batch_size,omitempty"`
|
BatchSize int `json:"batch_size,omitempty"`
|
||||||
UBatchSize int `json:"ubatch_size,omitempty"`
|
UBatchSize int `json:"ubatch_size,omitempty"`
|
||||||
Keep int `json:"keep,omitempty"`
|
Keep int `json:"keep,omitempty"`
|
||||||
FlashAttn bool `json:"flash_attn,omitempty"`
|
FlashAttn string `json:"flash_attn,omitempty"`
|
||||||
NoPerf bool `json:"no_perf,omitempty"`
|
NoPerf bool `json:"no_perf,omitempty"`
|
||||||
Escape bool `json:"escape,omitempty"`
|
Escape bool `json:"escape,omitempty"`
|
||||||
NoEscape bool `json:"no_escape,omitempty"`
|
NoEscape bool `json:"no_escape,omitempty"`
|
||||||
|
|||||||
@@ -34,11 +34,10 @@ func TestLlamaCppBuildCommandArgs_BooleanFields(t *testing.T) {
|
|||||||
name: "multiple booleans",
|
name: "multiple booleans",
|
||||||
options: backends.LlamaServerOptions{
|
options: backends.LlamaServerOptions{
|
||||||
Verbose: true,
|
Verbose: true,
|
||||||
FlashAttn: true,
|
|
||||||
Mlock: false,
|
Mlock: false,
|
||||||
NoMmap: true,
|
NoMmap: true,
|
||||||
},
|
},
|
||||||
expected: []string{"--verbose", "--flash-attn", "--no-mmap"},
|
expected: []string{"--verbose", "--no-mmap"},
|
||||||
excluded: []string{"--mlock"},
|
excluded: []string{"--mlock"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -239,25 +239,3 @@ func TestValidateInstanceOptions_MultipleFieldInjection(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestValidateInstanceOptions_NonStringFields(t *testing.T) {
|
|
||||||
// Test that non-string fields don't interfere with validation
|
|
||||||
options := backends.Options{
|
|
||||||
BackendType: backends.BackendTypeLlamaCpp,
|
|
||||||
LlamaServerOptions: &backends.LlamaServerOptions{
|
|
||||||
Port: 8080,
|
|
||||||
GPULayers: 32,
|
|
||||||
CtxSize: 4096,
|
|
||||||
Temperature: 0.7,
|
|
||||||
TopK: 40,
|
|
||||||
TopP: 0.9,
|
|
||||||
Verbose: true,
|
|
||||||
FlashAttn: false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
err := options.ValidateInstanceOptions()
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("ValidateInstanceOptions with non-string fields should not error, got: %v", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user