diff --git a/backend-golang/app.go b/backend-golang/app.go index 78639f9..901b7fd 100644 --- a/backend-golang/app.go +++ b/backend-golang/app.go @@ -28,12 +28,12 @@ func NewApp() *App { // so we can call the runtime methods func (a *App) OnStartup(ctx context.Context) { a.ctx = ctx - ex, _ := os.Executable() - a.exDir = filepath.Dir(ex) + a.exDir = "" a.cmdPrefix = "" if runtime.GOOS == "darwin" { - a.exDir += "/../../../" + ex, _ := os.Executable() + a.exDir = filepath.Dir(ex) + "/../../../" a.cmdPrefix = "cd " + a.exDir + " && " } diff --git a/backend-golang/rwkv.go b/backend-golang/rwkv.go index d20e018..c53ff0a 100644 --- a/backend-golang/rwkv.go +++ b/backend-golang/rwkv.go @@ -26,7 +26,7 @@ func (a *App) ConvertModel(python string, modelPath string, strategy string, out if err != nil { return "", err } - return Cmd(python, "./backend-python/convert_model.py", "--in", modelPath, "--out", outPath, "--strategy", `"`+strategy+`"`) + return Cmd(python, "./backend-python/convert_model.py", "--in", modelPath, "--out", outPath, "--strategy", strategy) } func (a *App) DepCheck(python string) error { diff --git a/backend-golang/utils.go b/backend-golang/utils.go index 3bfaf82..690458b 100644 --- a/backend-golang/utils.go +++ b/backend-golang/utils.go @@ -46,7 +46,7 @@ func Cmd(args ...string) (string, error) { return "", err } exDir := filepath.Dir(ex) + "/../../../" - cmd := exec.Command("osascript", "-e", `tell application "Terminal" to do script "`+"cd "+exDir+" && "+strings.Join(args, " ")+`"`) + cmd := exec.Command("osascript", "-e", `tell application 'Terminal' to do script '`+"cd "+exDir+" && "+strings.Join(args, " ")+`'`) err = cmd.Start() if err != nil { return "", err diff --git a/frontend/src/pages/Settings.tsx b/frontend/src/pages/Settings.tsx index 3e09c77..3c781fa 100644 --- a/frontend/src/pages/Settings.tsx +++ b/frontend/src/pages/Settings.tsx @@ -118,15 +118,17 @@ export const Settings: FC = observer(() => { {t('Advanced')} - { - commonStore.setSettings({ - customModelsPath: data.value - }); - }} /> - } /> + {commonStore.platform !== 'darwin' && + { + commonStore.setSettings({ + customModelsPath: data.value + }); + }} /> + } /> + }