Skip to content

Commit

Permalink
refactor(src-tauri): update dependencies and add platform-specific fi…
Browse files Browse the repository at this point in the history
…le handling
  • Loading branch information
Googlefan committed Sep 23, 2024
1 parent 66aa84a commit 276a309
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?
*.sbv2
*.sbv2
.aider*
18 changes: 9 additions & 9 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
mod tts;
use std::env;

use hf_hub::api::sync::Api;

#[tauri::command]
Expand All @@ -17,7 +19,13 @@ fn main() {
Api::new()
.unwrap()
.model("googlefan/sbv2_onnx_models".to_string())
.get("onnxruntime.dll")
.get(if cfg!(windows) {
"onnxruntime.dll"
} else if cfg!(target_os = "macos") {
"libonnxruntime.dylib"
} else {
"libonnxruntime.so"
})
.unwrap()
.to_string_lossy()
.to_string(),
Expand Down

0 comments on commit 276a309

Please sign in to comment.