This commit is contained in:
josc146
2023-05-17 21:20:41 +08:00
parent 11813454de
commit df8eef5f64
14 changed files with 438 additions and 121 deletions

View File

@@ -18,3 +18,16 @@ func (a *App) StartServer(port int) (string, error) {
}
return string(out), nil
}
func (a *App) ConvertModel(modelPath string, strategy string, outPath string) (string, error) {
cmdHelper, err := filepath.Abs("./cmd-helper")
if err != nil {
return "", err
}
cmd := exec.Command(cmdHelper, "python", "./backend-python/convert_model.py", "--in", modelPath, "--out", outPath, "--strategy", strategy)
out, err := cmd.CombinedOutput()
if err != nil {
return "", err
}
return string(out), nil
}