show request to server rather than local check (#778)

This commit is contained in:
Bruce MacDonald 2023-10-16 17:27:25 -04:00 committed by GitHub
parent 9ef2fce33a
commit 68d7255bd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -688,7 +688,12 @@ func generateInteractive(cmd *cobra.Command, model string) error {
case strings.HasPrefix(line, "/show"):
args := strings.Fields(line)
if len(args) > 1 {
resp, err := server.GetModelInfo(model)
client, err := api.ClientFromEnvironment()
if err != nil {
fmt.Println("error: couldn't connect to ollama server")
return err
}
resp, err := client.Show(cmd.Context(), &api.ShowRequest{Name: model})
if err != nil {
fmt.Println("error: couldn't get model")
return err