Skip to content

Commit

Permalink
Merge branch 'release/1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufcanb committed Mar 2, 2024
2 parents cca26d8 + f6760ab commit 38b632e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
12 changes: 8 additions & 4 deletions explain/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ func (e *Explain) before(_ *cli.Context) error {
os.Exit(-1)
}

found := false
for _, model := range list.Models {
if model.Name == e.modelfile {
return nil
if model.Name == e.modelfileName {
found = true
break
}
fmt.Println(shell.Err() + " " + "tlm explain:7b model not found.\n\nPlease run `tlm deploy` to deploy tlm models first.")
}

if !found {
fmt.Println(shell.Err() + " " + "tlm's explain model not found.\n\nPlease run `tlm deploy` to deploy tlm models first.")
os.Exit(-1)
return nil
}

return nil
Expand Down
7 changes: 4 additions & 3 deletions explain/explain.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
)

type Explain struct {
api *ollama.Client
modelfile string
api *ollama.Client
modelfile string
modelfileName string
}

func New(api *ollama.Client, modelfile string) *Explain {
e := &Explain{api: api, modelfile: modelfile}
e := &Explain{api: api, modelfile: modelfile, modelfileName: "explain:7b"}
return e
}
12 changes: 8 additions & 4 deletions suggest/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ func (s *Suggest) before(_ *cli.Context) error {
os.Exit(-1)
}

found := false
for _, model := range list.Models {
if model.Name == s.modelfile {
return nil
if model.Name == s.modelfileName {
found = true
break
}
fmt.Println(shell.Err() + " " + "tlm suggest:7b model not found.\n\nPlease run `tlm deploy` to deploy tlm models first.")
}

if !found {
fmt.Println(shell.Err() + " " + "tlm's suggest model not found.\n\nPlease run `tlm deploy` to deploy tlm models first.")
os.Exit(-1)
return nil
}

return nil
Expand Down
7 changes: 4 additions & 3 deletions suggest/suggest.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
)

type Suggest struct {
api *ollama.Client
modelfile string
api *ollama.Client
modelfile string
modelfileName string
}

func New(api *ollama.Client, modelfile string) *Suggest {
return &Suggest{api: api, modelfile: modelfile}
return &Suggest{api: api, modelfile: modelfile, modelfileName: "suggest:7b"}
}

0 comments on commit 38b632e

Please sign in to comment.