Skip to content

Commit 6aee7f8

Browse files
ilopezlunandeloof
authored andcommitted
gets back runtime flags when configuring models
Signed-off-by: Ignacio López Luna <[email protected]>
1 parent c89b8a2 commit 6aee7f8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/compose/model.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"github.com/compose-spec/compose-go/v2/types"
3030
"github.com/containerd/errdefs"
3131
"github.com/docker/cli/cli-plugins/manager"
32-
"github.com/sirupsen/logrus"
3332
"github.com/spf13/cobra"
3433
"golang.org/x/sync/errgroup"
3534

@@ -159,21 +158,21 @@ func (m *modelAPI) PullModel(ctx context.Context, model types.ModelConfig, quiet
159158
}
160159

161160
func (m *modelAPI) ConfigureModel(ctx context.Context, config types.ModelConfig, events api.EventProcessor) error {
162-
if len(config.RuntimeFlags) != 0 {
163-
logrus.Warnf("Runtime flags are not supported and will be ignored for model %s", config.Model)
164-
config.RuntimeFlags = nil
165-
}
166161
events.On(api.Resource{
167162
ID: config.Name,
168163
Status: api.Working,
169164
Text: api.StatusConfiguring,
170165
})
171-
// configure [--context-size=<n>] MODEL
166+
// configure [--context-size=<n>] MODEL [-- <runtime-flags...>]
172167
args := []string{"configure"}
173168
if config.ContextSize > 0 {
174169
args = append(args, "--context-size", strconv.Itoa(config.ContextSize))
175170
}
176171
args = append(args, config.Model)
172+
if len(config.RuntimeFlags) != 0 {
173+
args = append(args, "--")
174+
args = append(args, config.RuntimeFlags...)
175+
}
177176
cmd := exec.CommandContext(ctx, m.path, args...)
178177
err := m.prepare(ctx, cmd)
179178
if err != nil {

0 commit comments

Comments
 (0)