mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 00:54:23 +00:00
Implement common ParseCommand interface
This commit is contained in:
@@ -385,7 +385,9 @@ func TestParseLlamaCommand(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result, err := backends.ParseLlamaCommand(tt.command)
|
||||
var opts backends.LlamaServerOptions
|
||||
resultAny, err := opts.ParseCommand(tt.command)
|
||||
result, _ := resultAny.(*backends.LlamaServerOptions)
|
||||
|
||||
if tt.expectErr {
|
||||
if err == nil {
|
||||
@@ -413,7 +415,9 @@ func TestParseLlamaCommand(t *testing.T) {
|
||||
|
||||
func TestParseLlamaCommandArrays(t *testing.T) {
|
||||
command := "llama-server --model test.gguf --lora adapter1.bin --lora=adapter2.bin"
|
||||
result, err := backends.ParseLlamaCommand(command)
|
||||
var opts backends.LlamaServerOptions
|
||||
resultAny, err := opts.ParseCommand(command)
|
||||
result, _ := resultAny.(*backends.LlamaServerOptions)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
@@ -429,4 +433,4 @@ func TestParseLlamaCommandArrays(t *testing.T) {
|
||||
t.Errorf("expected lora[%d]=%s got %s", i, v, result.Lora[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user