mirror of
https://github.com/ollama/ollama.git
synced 2025-08-24 23:11:12 +02:00
Fix GetModelInfo (#11496)
--------- Co-authored-by: Richard Lyons <frob@cloudstaff.com>
This commit is contained in:
@@ -385,9 +385,15 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
|
|||||||
case "modelfile":
|
case "modelfile":
|
||||||
fmt.Println(resp.Modelfile)
|
fmt.Println(resp.Modelfile)
|
||||||
case "parameters":
|
case "parameters":
|
||||||
|
fmt.Println("Model defined parameters:")
|
||||||
if resp.Parameters == "" {
|
if resp.Parameters == "" {
|
||||||
fmt.Println("No parameters were specified for this model.")
|
fmt.Println(" No additional parameters were specified for this model.")
|
||||||
} else {
|
} else {
|
||||||
|
for _, l := range strings.Split(resp.Parameters, "\n") {
|
||||||
|
fmt.Printf(" %s\n", l)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Println()
|
||||||
if len(opts.Options) > 0 {
|
if len(opts.Options) > 0 {
|
||||||
fmt.Println("User defined parameters:")
|
fmt.Println("User defined parameters:")
|
||||||
for k, v := range opts.Options {
|
for k, v := range opts.Options {
|
||||||
@@ -395,9 +401,6 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
|
|||||||
}
|
}
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
}
|
}
|
||||||
fmt.Println("Model defined parameters:")
|
|
||||||
fmt.Println(resp.Parameters)
|
|
||||||
}
|
|
||||||
case "system":
|
case "system":
|
||||||
switch {
|
switch {
|
||||||
case opts.System != "":
|
case opts.System != "":
|
||||||
|
@@ -842,8 +842,11 @@ func GetModelInfo(req api.ShowRequest) (*api.ShowResponse, error) {
|
|||||||
}
|
}
|
||||||
resp.Parameters = strings.Join(params, "\n")
|
resp.Parameters = strings.Join(params, "\n")
|
||||||
|
|
||||||
|
if len(req.Options) > 0 {
|
||||||
|
if m.Options == nil {
|
||||||
|
m.Options = make(map[string]any)
|
||||||
|
}
|
||||||
for k, v := range req.Options {
|
for k, v := range req.Options {
|
||||||
if _, ok := req.Options[k]; ok {
|
|
||||||
m.Options[k] = v
|
m.Options[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user