diff --git a/fire_seq_search_server/Cargo.toml b/fire_seq_search_server/Cargo.toml index 3fd1101..e052d4f 100644 --- a/fire_seq_search_server/Cargo.toml +++ b/fire_seq_search_server/Cargo.toml @@ -47,7 +47,7 @@ stop-words = "0.7.2" regex = "1" lingua = { version = "1.4.0", default-features = false, features = ["chinese", "english"] } - +shellexpand = "3.1" #Highlight (Output) html-escape = "0.2.13" @@ -63,6 +63,7 @@ pdf-extract-temporary-mitigation-panic = "0.7.1" # llm related +# TODO I should make them optional sha256 = "1.5.0" reqwest = { version = "0.12", features = ["json"] } futures = "0.3" diff --git a/fire_seq_search_server/src/local_llm/mod.rs b/fire_seq_search_server/src/local_llm/mod.rs index 9ba88e1..0b15c9e 100644 --- a/fire_seq_search_server/src/local_llm/mod.rs +++ b/fire_seq_search_server/src/local_llm/mod.rs @@ -286,8 +286,8 @@ struct LlamaFileDef { } +use shellexpand::tilde; async fn locate_llamafile() -> Option { - // TODO let mut lf = LlamaFileDef { filename: "mistral-7b-instruct-v0.2.Q4_0.llamafile".to_owned(), filepath: None, @@ -295,10 +295,8 @@ async fn locate_llamafile() -> Option { download_link: "mistral-7b-instruct-v0.2.Q4_0.llamafile".to_owned(), }; - // TODO hack in dev - //let lf_path = "/var/home/lizhenbo/Downloads/mistral-7b-instruct-v0.2.Q4_0.llamafile"; - let lf_base = "/Users/zhenboli/.llamafile/"; - let lf_path = lf_base.to_owned() + &lf.filename; + let lf_base = tilde("~/.llamafile/"); + let lf_path = lf_base.to_string() + &lf.filename; lf.filepath = Some( lf_path.to_owned() ); info!("lf {:?}", &lf);