Open thewh1teagle opened 2 weeks ago
Thank you for reporting this issue. I was able to reproduce it and will investigate what is blocking the termination.
Regarding model files, I am using Hugging Face and have uploaded some models for CTranslate2. You can create an account and upload your model files there.
This code snippet downloads the model files and returns the directory path:
let api = hf_hub::api::sync::Api::new()?;
let repo = api.model("<your account name>/<repo>");
let mut res = None;
for f in repo.info()?.siblings {
let path = repo.get(&f.rfilename)?;
if res.is_none() {
res = path.parent().map(PathBuf::from);
}
}
// path to the directory that contains the model file
res.ok_or_else(|| anyhow!("no model files are found"))
Thank you for reporting this issue. I was able to reproduce it and will investigate what is blocking the termination.
Let me know if you have any ideas about where it might be. I tried to debug it but couldn't find a good way to do so in Windows. If you find a way, I'd appreciate it if you could share your insights.
Regarding model files, I am using Hugging Face and have uploaded some models for CTranslate2. You can create an account and upload your model files there.
This code snippet downloads the model files and returns the directory path:
Thanks for the code. eventually I created custom downloader since I needed to get progress callbacks
It looks like the join
method here blocks forever:
https://github.com/OpenNMT/CTranslate2/blob/master/src/thread_pool.cc#L106
However, I’m not sure why this happens, since the worker threads appear to end correctly.
I tried examples/nllb.rs and it works. but when the translate finish, the process hangs for few minutes, and ctrl + c doesn't exit it. Is there some cleanup? can we speed it up?
And another question: Is there a place I can download the needed folder for translate that will work for
mac
/windows
/linux
? I usefacebook/nllb-200-distilled-600M
I tried to zip the folder created onmac
and use it in windows but it didn't worked. I had to use transformers to create it on each platform. The goal is to have something I can use right away for cross platform desktop app for offline translations.Thanks for this amazing library!
Update
Looks like it hangs on
drop(t)
wheret
is the translator instance