fix: vocabulary.txt / shared_vocabulary.txt should be optional (#225)

improve-workflow
Meng Zhang 2023-06-08 23:49:09 -07:00 committed by GitHub
parent 6564cf7ef9
commit eecdde0269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -55,17 +55,16 @@ pub async fn download_model(model_id: &str, prefer_local_file: bool) -> Result<(
cache_info
.download(model_id, "ctranslate2/config.json", prefer_local_file)
.await?;
cache_info
let _ = cache_info
.download(model_id, "ctranslate2/vocabulary.txt", prefer_local_file)
.await?;
cache_info
.await;
let _ = cache_info
.download(
model_id,
"ctranslate2/shared_vocabulary.txt",
prefer_local_file,
)
.await
.unwrap_or(());
.await;
cache_info
.download(model_id, "ctranslate2/model.bin", prefer_local_file)
.await?;