Skip to content

Commit

Permalink
🐛 fixes #24 and #25
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufcanb committed Apr 14, 2024
1 parent 261b103 commit 0763640
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions explain/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ func (e *Explain) StreamExplanationFor(mode, prompt string) error {
if err != nil {
fmt.Println("Error during generation:", err)
}
fmt.Printf("\n")
return nil
}
6 changes: 3 additions & 3 deletions explain/explain.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
var modelFile string

type Explain struct {
api *ollama.Client

api *ollama.Client
version string
tag string
modelfile string
}
Expand All @@ -26,5 +26,5 @@ func (e *Explain) Modelfile() string {

func New(api *ollama.Client, version string) *Explain {
modelfileName := fmt.Sprintf("tlm:%s-e", version)
return &Explain{api: api, tag: modelfileName, modelfile: modelFile}
return &Explain{api: api, tag: modelfileName, modelfile: modelFile, version: version}
}
2 changes: 1 addition & 1 deletion suggest/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (s *Suggest) action(c *cli.Context) error {
if form.action == Explain {
fmt.Println(shell.SuccessMessage("┃ > ") + "Explaining..." + "\n")

exp := explain.New(s.api, "")
exp := explain.New(s.api, s.version)
err = exp.StreamExplanationFor(Stable, form.command)
if err != nil {
return err
Expand Down
3 changes: 2 additions & 1 deletion suggest/suggest.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var suggestModelfile string

type Suggest struct {
api *ollama.Client
version string
tag string
modelfile string
}
Expand All @@ -25,5 +26,5 @@ func (s *Suggest) Modelfile() string {

func New(api *ollama.Client, version string) *Suggest {
tag := fmt.Sprintf("tlm:%s-s", version)
return &Suggest{api: api, tag: tag, modelfile: suggestModelfile}
return &Suggest{api: api, tag: tag, modelfile: suggestModelfile, version: version}
}

0 comments on commit 0763640

Please sign in to comment.