Skip to content

Commit bbf4ba5

Browse files
committed
fix duplicated model resolution
1 parent f46dc26 commit bbf4ba5

1 file changed

Lines changed: 3 additions & 19 deletions

File tree

cmd/inference_text.go

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Examples:
4242
RunE: runTextInference,
4343
}
4444

45+
var model string
46+
4547
func init() {
4648
f := textInferenceCmd.Flags()
4749
f.StringVarP(&textFlags.model, "model", "m", "", "Model identifier (e.g. runware:qwen3-thinking@1)")
@@ -67,7 +69,7 @@ func init() {
6769

6870
func preRunTextInference(cmd *cobra.Command, _ []string) error {
6971
// Resolve model from preset or flag for early validation
70-
model := config.Get().Defaults.Model
72+
model = config.Get().Defaults.Model
7173
if textFlags.preset != "" {
7274
if preset := config.GetPreset(textFlags.preset); preset != nil && preset.Model != "" {
7375
model = preset.Model
@@ -94,24 +96,6 @@ func runTextInference(cmd *cobra.Command, args []string) error {
9496

9597
message := args[0]
9698

97-
model := config.Get().Defaults.Model
98-
99-
// Apply preset if specified
100-
if textFlags.preset != "" {
101-
preset := config.GetPreset(textFlags.preset)
102-
if preset == nil {
103-
return fmt.Errorf("preset '%s' not found", textFlags.preset)
104-
}
105-
if preset.Model != "" {
106-
model = preset.Model
107-
}
108-
}
109-
110-
// Override with explicit CLI flags
111-
if cmd.Flags().Changed("model") {
112-
model = textFlags.model
113-
}
114-
11599
// Build request
116100
req := &api.TextInferenceRequest{
117101
TaskUUID: api.NewUUID(),

0 commit comments

Comments
 (0)