Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load model from the another path #46

Open
ArkaitzSKR opened this issue Mar 12, 2024 · 4 comments
Open

Load model from the another path #46

ArkaitzSKR opened this issue Mar 12, 2024 · 4 comments
Labels
question Further information is requested

Comments

@ArkaitzSKR
Copy link

Hello!
Is it possible to use the library by importing the model instead of from the assets folder from a different location?

We are trying to use the library with 4.5GB models and by entering it in the assets it is impossible to compile.

In the tests we have carried out we get an error with a file called uuid. This file is generated by Android Studio when compiling the assets and contains, as the name indicates, a uuid. We have tried putting a uuid file in the external storage in the same folder where the model is located but it still gives us the same error.

Is there any limit on the size of the model?

Thanks in advance and greetings!

@riderodd
Copy link
Owner

Hi @ArkaitzSKR,

For the UUID generation, take a look at the build.gradle task that handle this, it may help:
https://github.com/riderodd/react-native-vosk/blob/3903c0e96d16f251e278441861b4acb250c9f47f/android/build.gradle#L85C1-L98C27

Maybe by changing the path you can handle a different storage location. The library should work with all models, no matter the size. If it's not, it may be related to device capacity ?

Maybe if you could share the error and what you've already tried, we may try to think about a fix together :)

@vidman22
Copy link

I'm hoping to download from remote and unzip the files into the DocumentDirectoryPath and then load the model. Is this also possible?

@riderodd
Copy link
Owner

I really don't know, the only way is try. Generally and from my only and personaly experience, Android is more permissive with this type of approach than iOS. If you succeed in your tries feel free to let us know, that would be nice to explain how to do it in the docs !

@riderodd riderodd added the question Further information is requested label Apr 12, 2024
@vidman22
Copy link

I really don't know, the only way is try. Generally and from my only and personaly experience, Android is more permissive with this type of approach than iOS. If you succeed in your tries feel free to let us know, that would be nice to explain how to do it in the docs !

I couldn't get it to work on iOS, i'll check on Android soon. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants