RWKV-Runner/backend-golang/rwkv.go
2023-05-17 11:39:00 +08:00

21 lines
402 B
Go

package backend_golang
import (
"os/exec"
"path/filepath"
"strconv"
)
func (a *App) StartServer(port int) (string, error) {
cmdHelper, err := filepath.Abs("./cmd-helper")
if err != nil {
return "", err
}
cmd := exec.Command(cmdHelper, "python", "./backend-python/main.py", strconv.Itoa(port))
out, err := cmd.CombinedOutput()
if err != nil {
return "", err
}
return string(out), nil
}