Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/api/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ const (
StatusExported = "Exported"
StatusDownloading = "Downloading"
StatusDownloadComplete = "Download complete"
StatusConfiguring = "Configuring"
StatusConfigured = "Configured"
)

// Resource represents status change and progress for a compose resource.
Expand Down
16 changes: 13 additions & 3 deletions pkg/compose/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (m *modelAPI) PullModel(ctx context.Context, model types.ModelConfig, quiet
events.On(api.Resource{
ID: model.Name,
Status: api.Working,
Text: "Pulling",
Text: api.StatusPulling,
})

cmd := exec.CommandContext(ctx, m.path, "pull", model.Model)
Expand Down Expand Up @@ -161,7 +161,7 @@ func (m *modelAPI) ConfigureModel(ctx context.Context, config types.ModelConfig,
events.On(api.Resource{
ID: config.Name,
Status: api.Working,
Text: "Configuring",
Text: api.StatusConfiguring,
})
// configure [--context-size=<n>] MODEL
args := []string{"configure"}
Expand All @@ -174,7 +174,17 @@ func (m *modelAPI) ConfigureModel(ctx context.Context, config types.ModelConfig,
if err != nil {
return err
}
return cmd.Run()
err = cmd.Run()
if err != nil {
events.On(errorEvent(config.Name, err.Error()))
return err
}
events.On(api.Resource{
ID: config.Name,
Status: api.Done,
Text: api.StatusConfigured,
})
return nil
}

func (m *modelAPI) SetModelVariables(ctx context.Context, project *types.Project) error {
Expand Down