15 lines
318 B
Go
Raw Normal View History

2023-05-06 23:39:23 +08:00
package backend_golang
import (
"os/exec"
)
2023-05-13 20:15:18 +08:00
func (a *App) StartServer(strategy string, modelPath string) (string, error) {
2023-05-06 23:39:23 +08:00
cmd := exec.Command("cmd-helper", "python", "./backend-python/main.py", strategy, modelPath)
out, err := cmd.CombinedOutput()
if err != nil {
2023-05-13 20:15:18 +08:00
return "", err
2023-05-06 23:39:23 +08:00
}
2023-05-13 20:15:18 +08:00
return string(out), nil
2023-05-06 23:39:23 +08:00
}