shubham0204 / Android-Document-QA

A custom RAG pipeline for multi-document QA from PDF/DOCX documents, in Android
Apache License 2.0
49 stars 2 forks source link

When running the application it fails almost imediately as the SAVED_STATE_REGISTRY_OWNER_KEY is not getting set #10

Open dcrowleyMunster opened 4 days ago

dcrowleyMunster commented 4 days ago

This is the error as seen in the LogCat output - Any Ides ?

FATAL EXCEPTION: main Process: com.ml.shubham0204.docqa, PID: 9805 java.lang.IllegalArgumentException: CreationExtras must have a value by SAVED_STATE_REGISTRY_OWNER_KEY at androidx.lifecycle.SavedStateHandleSupport.createSavedStateHandle(SavedStateHandleSupport.kt:89)

shubham0204 commented 4 days ago

This issue has been reported in #4. Can you try updating the dependency as I mentioned in this comment: https://github.com/shubham0204/Android-Document-QA/issues/4#issuecomment-2272740674

dcrowleyMunster commented 4 days ago

There seems to be something missing still. Here is what I have setup from a configuration perspective, so if you see anything please let me know:

var dagger_hilt_version = "2.43.2" var navigation_version = "2.5.1" var compose_version = "1.2.0" var kotlin_version = "1.7.0"

implementation("androidx.lifecycle:lifecycle-viewmodel-compose:$navigation_version") implementation("androidx.hilt:hilt-navigation-compose:1.1.0-alpha01") implementation("androidx.activity:activity-compose:1.5.0") implementation("androidx.navigation:navigation-compose:$navigation_version")

implementation("androidx.navigation:navigation-fragment-ktx:$navigation_version")
implementation("androidx.navigation:navigation-ui-ktx:$navigation_version")
implementation("androidx.navigation:navigation-dynamic-features-fragment:$navigation_version")
androidTestImplementation("androidx.navigation:navigation-testing:$navigation_version")

implementation("com.google.dagger:hilt-android:$dagger_hilt_version")
kapt("com.google.dagger:hilt-android-compiler:$dagger_hilt_version")
testImplementation("com.google.dagger:hilt-android-testing:$dagger_hilt_version")
kaptTest("com.google.dagger:hilt-android-compiler:$dagger_hilt_version")
androidTestImplementation("com.google.dagger:hilt-android-testing:$dagger_hilt_version")
kaptAndroidTest("com.google.dagger:hilt-android-compiler:$dagger_hilt_version")

// Unit tests
testImplementation("androidx.navigation:navigation-testing:2.5.1")

// UI tests androidTestImplementation("androidx.navigation:navigation-testing:2.5.1")

shubham0204 commented 4 days ago

The error is caused because of Hilt. In this PR #12 , I have migrated the project from Hilt to Koin for dependency injection which should solve any issues. You can use the code from that branch and let me know if it works.

dcrowleyMunster commented 3 days ago

Thank you. Updating now, I will update once done.

On another note, did you ever think about keeping the external documentation accessible via a URL instead of on the device ?

shubham0204 commented 2 days ago

On another note, did you ever think about keeping the external documentation accessible via a URL instead of on the device?

Currently, the focus is to have a complete on-device RAG application, so the documents are also stored on device. But fetching them from a remote URL shouldn't require more changes in the existing codebase.

You can write a small component that downloads the documents first and then chunks them in the ObjectBox vector-store. The latter part is already included the project.

dcrowleyMunster commented 1 day ago

Initially I had envisaged having the datastore external to the wireless device, with the thought process being that if you are serving many users, then changing the and updating, re-indexing the data externally might be a better architecture, rather than trying to upload the new data. So, the vector-store and would be external.

However that being said, for smaller documents this solution is perfect, especially if the wireless connection (Wi-Fi and Cellular) is not connected or intermittent.

I'll try the external upload and then update, should be a quick addition.

dcrowleyMunster commented 1 day ago

testing this morning and its impressive. more to the point fast