Skip to content

Commit

Permalink
fix: qunyou
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Dec 1, 2023
1 parent 23429be commit 8273c97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/qunyou/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ func init() {
en.OnMessagePrefix("看看群友").Limit(ctxext.LimitByGroup).Handle(func(ctx *nano.Ctx) {
prompt := ctx.State["args"].(string)
sb := strings.Builder{}
errsb := strings.Builder{}
cmd := exec.Cmd{
Path: "/usr/local/bin/llama2.run",
Args: []string{"model.bin"},
Args: []string{"/usr/local/bin/llama2.run", "model.bin"},
Dir: "/usr/local/src/llama2.c",
Stdout: &sb,
Stderr: &errsb,
}
if prompt != "" {
cmd.Args = append(cmd.Args, "-i", prompt)
}
err := cmd.Run()
if err != nil {
ctx.SendChain(nano.Text("ERROR: ", err))
ctx.SendChain(nano.Text("ERROR: ", err, errsb.String()))

Check failure on line 35 in plugin/qunyou/main.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `ctx.SendChain` is not checked (errcheck)

Check failure on line 35 in plugin/qunyou/main.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `ctx.SendChain` is not checked (errcheck)
return
}
ctx.SendChain(nano.Text(sb.String()))

Check failure on line 38 in plugin/qunyou/main.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `ctx.SendChain` is not checked (errcheck)

Check failure on line 38 in plugin/qunyou/main.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `ctx.SendChain` is not checked (errcheck)
Expand Down

0 comments on commit 8273c97

Please sign in to comment.