mirror of
https://github.com/neodyland/sbv2-api.git
synced 2026-01-03 21:12:57 +00:00
fix
This commit is contained in:
@@ -43,4 +43,5 @@ aivmx = ["npyz", "base64"]
|
||||
base64 = ["dep:base64"]
|
||||
|
||||
[build-dependencies]
|
||||
home-dir = "0.1.0"
|
||||
ureq = "3.0.6"
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::io::copy;
|
||||
use std::path::Path;
|
||||
|
||||
use home_dir::HomeDirExt;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let out_dir = env::var("OUT_DIR")?;
|
||||
let out_path = Path::new(&out_dir).join("all.bin");
|
||||
let out_dir = "~/.cache/sbv2-api-assets".expand_home().unwrap();
|
||||
let out_path = out_dir.join("all.bin");
|
||||
if !out_path.exists() {
|
||||
if !out_dir.exists() {
|
||||
fs::create_dir_all(out_dir).unwrap();
|
||||
}
|
||||
println!("cargo:warning=Downloading dictionary file...");
|
||||
let mut response =
|
||||
ureq::get("https://huggingface.co/neody/sbv2-api-assets/resolve/main/dic/all.bin")
|
||||
|
||||
Reference in New Issue
Block a user