fs: fix cfg display — dereference pointer fields, omit when nil
temperature, topP, topK are *float64/*int pointers. Previously printed as hex addresses or <nil>. Now shows actual values when set, omitted when nil.
This commit is contained in:
parent
2c26a7fb9c
commit
68b844bbfa
|
|
@ -567,10 +567,18 @@ func readAgentCfg(ctx HandlerCtx) ([]byte, error) {
|
|||
fmt.Fprintf(&sb, "cwd=%s\n", ctx.Agent.Cwd())
|
||||
fmt.Fprintf(&sb, "remote=%s\n", ctx.AgentLog.remote)
|
||||
fmt.Fprintf(&sb, "maxTokens=%d\n", p.MaxTokens)
|
||||
fmt.Fprintf(&sb, "temperature=%v\n", p.Temperature)
|
||||
fmt.Fprintf(&sb, "topP=%v\n", p.TopP)
|
||||
fmt.Fprintf(&sb, "topK=%v\n", p.TopK)
|
||||
fmt.Fprintf(&sb, "stop=%v\n", p.Stop)
|
||||
if p.Temperature != nil {
|
||||
fmt.Fprintf(&sb, "temperature=%g\n", *p.Temperature)
|
||||
}
|
||||
if p.TopP != nil {
|
||||
fmt.Fprintf(&sb, "topP=%g\n", *p.TopP)
|
||||
}
|
||||
if p.TopK != nil {
|
||||
fmt.Fprintf(&sb, "topK=%d\n", *p.TopK)
|
||||
}
|
||||
if len(p.Stop) > 0 {
|
||||
fmt.Fprintf(&sb, "stop=%s\n", strings.Join(p.Stop, ","))
|
||||
}
|
||||
return []byte(sb.String()), nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue