Created
December 21, 2023 09:14
-
-
Save a-agmon/2b510c1d7d4e6f9a14cbcf2e052cccb0 to your computer and use it in GitHub Desktop.
loading embeddings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let embeddings = match embeddings_filename.is_empty() { | |
true => { | |
println!("no file name provided"); | |
Tensor::new(&[0.0], &device)? | |
} | |
false => { | |
let tensor_file = safetensors::load(embeddings_filename, &device)?; | |
tensor_file | |
.get(embeddings_key) | |
.expect("error getting key:embedding") | |
.clone() | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment