Skip to content

Commit

Permalink
fix: failed to download tokernizer from HF (#1060)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunYang-tes authored Jan 9, 2025
1 parent 225e6f9 commit 6c10081
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/avante-tokenizers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ impl HuggingFaceTokenizer {

if !cached_path.exists() {
let response = ureq::get(url).call().unwrap();
let _ = std::fs::write(&cached_path, response.into_string().unwrap());
let mut file = std::fs::File::create(&cached_path).unwrap();
let mut reader = response.into_reader();
std::io::copy(&mut reader, &mut file).unwrap();
}
cached_path
}
Expand Down

0 comments on commit 6c10081

Please sign in to comment.