Closed kj3moraes closed 10 months ago
Model is lazy-downloaded - you need to use model at least once to make sure you download the model. Minimal example code to download the model:
#[test]
fn test_load_using_bert() -> anyhow::Result<()> {
let model = SentenceEmbeddingsModel::new(SentenceEmbeddingsConfig::from(SentenceEmbeddingsModelType::ParaphraseAlbertSmallV2))?;
dbg!(model.encode(&["This is a test sentence."])?);
Ok(())
}
Fair enough. Is there a way to say at model initialization that when the model is downloaded I want it downloaded to my_cache_dir
instead of ~/.cache/.rustbert
?
Models get downloaded to the RUSTBERT_CACHE
environment variable if set
Ok, thanks that solves it.
Hello there, I recently started using rust-bert and I wanted to know what the right way was to
Currently I am doing something like this
This code would not save to my MODELS_CACHE_DIR. Using RemoteResources to specify modules_config, transformer_config, etc. will not download these to that specific directory, it just declares these paths.