niedev / RTranslator

Open source real-time translation app for Android that runs locally
Apache License 2.0
6.85k stars 518 forks source link

[Question]Why does the software stop when it downloads NLLB encoder up to 0.69G and suggests that there is no internet? #71

Closed bugxzhu closed 4 weeks ago

bugxzhu commented 2 months ago

Why does the software stop when it downloads NLLB encoder up to 0.69G and suggests that there is no internet? Is there a way to just download the model and put it in a directory?This would avoid problems with downloading.

bugxzhu commented 2 months ago

WechatIMG355

niedev commented 2 months ago

Why does the software stop when it downloads NLLB encoder up to 0.69G and suggests that there is no internet?

Some regions, like China, have problems with the download.

Is there a way to just download the model and put it in a directory?This would avoid problems with downloading.

Yes! See here for the instructions.

bugxzhu commented 2 months ago

Why does the software stop when it downloads NLLB encoder up to 0.69G and suggests that there is no internet?

Some regions, like China, have problems with the download.

Is there a way to just download the model and put it in a directory?This would avoid problems with downloading.

Yes! See here for the instructions.

@niedev I don't think so。Because I already use vpn. NLLB_encoder.onnx失败 - 需要获得授权

Is this error an authorization issue? others can be downloaded。

bugxzhu commented 2 months ago

1725861008425 @niedev

niedev commented 2 months ago

@niedev I don't think so。Because I already use vpn. NLLB_encoder.onnx失败 - 需要获得授权

I tested the download on my phone and it works fine, after the error message did you try the download again and it always gets stuck on the same file? (sometimes the download can have random errors and retrying it works), also did you try to download it from PC and do sideloading?

bugxzhu commented 2 months ago

@niedev thanks。I success to download it on PC。 but the “Android/data/nie.translator.rtranslator/files” folder cannot be accessed. Can you provide an additional path for uploading models in the app?

niedev commented 2 months ago

@bugxzhu For now that's the only path, in the future I will probably add another, anyway it is strange that it isn't accessible, what OS do you have on PC?

bugxzhu commented 2 months ago

@niedev It has little to do with the OS.It's because of a limitation of the phone's system that prevents access to the data directory in the Android directory, which is locked for security reasons.

niedev commented 2 months ago

@bugxzhu it may have to do with the OS of your PC, because normally that folder is hidden in the phone itself (not for security reason but to preventing people from breaking an app accidentally), but it is accessible with a PC (I don't make a tutorial without testing it and doing some research)

lrq3000 commented 3 days ago

I had the same issue today. And I could debug and fix it.

It happened after I paused the download for one day, because I didn't have time nor the storage space to complete the download and I didn't know before launching how much space was needed.

Then when i relaunched the app one day later and restarted the download, it progressed a bit, then failed similarly, telling me that my internet connection had issues.

I retried several times to no avail. It alwayt failed at the exact same percentage, hence why I suspected there was a bug, not a network error.

Finally I suspected that maybe the app started downloading a part of the data and is somehow tripping up when trying to resume downloading the rest, maybe a checksum verification failure because of improper download resuming, so I went to Android's applications listing in Settings and cleared all data (not just the cache) for RTranslator (after force killing it). Then I restarted the app and everything was working fine.

So i would suggest to maybe offer a way in the app to clear all data at this stage if the download fails several times in a row.

niedev commented 1 day ago

@lrq3000 Thank you for reporting your solution, but this is strange, since the app downloads one model at a time and then, as you also said, verifies the integrity of that model. However the application does not have a real mechanism to resume downloads, when the download is paused, it simply cancels the download of the current model and when the resume button is pressed it re-runs it from scratch (starting from that model, the previously downloaded ones have already been verified and will remain), so the source of the bug could be more complicated than that, if more reports come in I will investigate on this.

lrq3000 commented 1 day ago

I suspected that the software was intending to restart the whole downloading process, my guess is that a file is left behind that is not accounted for in case of a restart and if this file is corruptet, it never gets properly redownloaded, and so it trips up one of the integrity checks.

If that's the case, it will be hard to debug. Maybe AI can help with finding this by simulation of a unit test.