Giter VIP home page Giter VIP logo

Comments (5)

Lyokone avatar Lyokone commented on June 3, 2024

Hello @saurabhkumar8112, going through the native code, we are not setting a custom redownload or path compared to the native libraries. I cannot find any specific documentation about models being redownloaded manually. When you mention app upgrade, does it mean that you are only updating dart code, or native libraries as well? My guess is that changing the firebase_core could impact how the hash is calculated.

from flutterfire.

saurabhkumar8112 avatar saurabhkumar8112 commented on June 3, 2024

Thanks for your reply @Lyokone
By app upgrade I meant, upgrading to a new version available on play-store/app-store.
We use upgrader to ask users to upgrade the app when a new version is available.

My guess is that changing the firebase_core could impact how the hash is calculated

I think hash is not a problem here. As long as the model file is same, MD5 should return the same hash. My speculation is the local file path which is used to check whether there's already an available model might be different or the logic could be flawed.

This is how the path to model looks like on a device
/data/user/0/app_id/no_backup/com.google.firebase.ml.custom.models/some_hash/model_name/**id**
This can be retrieved by printing model.path

The id parameter is an integer.

What made me believe that model is getting downloaded multiple times after each app upgrade is, after app upgrade theidparameter increases by 1 even though its the same model on remote.

Which is not the expected behaviour. The mode should only be re-download when model updates on remote.

Even looking at the native code, I couldn't see a condition where the plugin checks for already installed models, compares hash and then only proceeds.

Am I missing something?
image

from flutterfire.

Lyokone avatar Lyokone commented on June 3, 2024

When referring to the native code, we are only bridging using the native android and iOS SDK.
I had a look at the native code for Android and couldn't find any condition that would force to redownload the model: https://github.com/firebase/firebase-android-sdk/blob/master/firebase-ml-modeldownloader/src/main/java/com/google/firebase/ml/modeldownloader/FirebaseModelDownloader.java

You can probably open an issue on this repository to see if the native team has an idea about what could be happening: https://github.com/firebase/firebase-android-sdk

from flutterfire.

google-oss-bot avatar google-oss-bot commented on June 3, 2024

Hey @saurabhkumar8112. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

from flutterfire.

google-oss-bot avatar google-oss-bot commented on June 3, 2024

Since there haven't been any recent updates here, I am going to close this issue.

@saurabhkumar8112 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

from flutterfire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.