lightning-joyce / chromeai

Chrome Built-in AI Demo page
https://chromeai.co
MIT License
78 stars 8 forks source link

New function request: Manually load the model #2

Open Tinnci opened 2 weeks ago

Tinnci commented 2 weeks ago

Hi, I found an internal page that might be able to manually load the model (chrome://on-device-internals/). As I can't find a way to make the 'Optimization Guide On Device Model' option appear in chrome://components, I can't test that out myself. I'm wondering if there's any way you might be able to perhaps provide a copy for the Gemini nano model so that users may load manually.

Tinnci commented 2 weeks ago

model for chrome should be under 'C:\Users\XX\AppData\Local\Google\Chrome SxS\User Data', according to relevant chromium issue(https://issues.chromium.org/issues/339471377), gemini nano on device used to have whitelist, wondering whether such whitelist is still a thing.

Histogram in my chrome shows that:

- Histogram: OptimizationGuide.ModelExecution.FeatureCurrentlyEnabledResult.Compose recorded 1 samples, mean = 3.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.FeatureCurrentlyEnabledResult.Compose)]
0  ... 
3  -O                                                                        (1 = 100.0%) {0.0%}
4  ... 

- Histogram: OptimizationGuide.ModelExecution.FeatureCurrentlyEnabledResult.TabOrganization recorded 2 samples, mean = 3.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.FeatureCurrentlyEnabledResult.TabOrganization)]
0  ... 
3  --O                                                                       (2 = 100.0%) {0.0%}
4  ... 

- Histogram: OptimizationGuide.ModelExecution.FeatureCurrentlyEnabledResult.WallpaperSearch recorded 1 samples, mean = 1.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.FeatureCurrentlyEnabledResult.WallpaperSearch)]
0  O                                                                         (0 = 0.0%)
1  -O                                                                        (1 = 100.0%) {0.0%}
2  ... 

- Histogram: OptimizationGuide.ModelExecution.FeatureEnabledAtStartup.Compose recorded 1 samples, mean = 0.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.FeatureEnabledAtStartup.Compose)]
0  -O                                                                        (1 = 100.0%)
1  ... 

- Histogram: OptimizationGuide.ModelExecution.FeatureEnabledAtStartup.TabOrganization recorded 1 samples, mean = 0.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.FeatureEnabledAtStartup.TabOrganization)]
0  -O                                                                        (1 = 100.0%)
1  ... 

- Histogram: OptimizationGuide.ModelExecution.FeatureEnabledAtStartup.WallpaperSearch recorded 1 samples, mean = 0.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.FeatureEnabledAtStartup.WallpaperSearch)]
0  -O                                                                        (1 = 100.0%)
1  ... 

- Histogram: OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.All recorded 1 samples, mean = 0.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.All)]
0  -O                                                                        (1 = 100.0%)
1  ... 

- Histogram: OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.DeviceCapability recorded 1 samples, mean = 1.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.DeviceCapability)]
0  O                                                                         (0 = 0.0%)
1  -O                                                                        (1 = 100.0%) {0.0%}
2  O                                                                         (0 = 0.0%) {100.0%}

- Histogram: OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.DiskSpace recorded 1 samples, mean = 0.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.DiskSpace)]
0  -O                                                                        (1 = 100.0%)
1  ... 

- Histogram: OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.EnabledByEnterprisePolicy recorded 1 samples, mean = 1.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.EnabledByEnterprisePolicy)]
0  O                                                                         (0 = 0.0%)
1  -O                                                                        (1 = 100.0%) {0.0%}
2  O                                                                         (0 = 0.0%) {100.0%}

- Histogram: OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.EnabledByFeature recorded 1 samples, mean = 1.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.EnabledByFeature)]
0  O                                                                         (0 = 0.0%)
1  -O                                                                        (1 = 100.0%) {0.0%}
2  O                                                                         (0 = 0.0%) {100.0%}

- Histogram: OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.FeatureUse recorded 1 samples, mean = 0.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.OnDeviceModelInstallCriteria.AtRegistration.FeatureUse)]
0  -O                                                                        (1 = 100.0%)
1  ... 

- Histogram: OptimizationGuide.ModelExecution.OnDeviceModelPerformanceClass recorded 1 samples, mean = 4.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.OnDeviceModelPerformanceClass)]
0  ... 
4  -O                                                                        (1 = 100.0%) {0.0%}
5  ... 

- Histogram: OptimizationGuide.ModelExecution.OnDeviceTextSafetyModelMetadataValidity recorded 1 samples, mean = 4.0 (flags = 0x41) [[#](chrome://histograms/#OptimizationGuide.ModelExecution.OnDeviceTextSafetyModelMetadataValidity)]
0  ... 
4  -O                                                                        (1 = 100.0%) {0.0%}
5  O                                                                         (0 = 0.0%) {100.0%}

GPT says such log indicates insufficient space on my disk, but I do have more than 40g remaining. Don't know what's the problem.

Tuoris commented 1 week ago

Optimization Guide On Device Model is missing for me too.

@lightning-joyce , could you please share the component ID for Optimization Guide On Device Model from chrome://components/ - this might help us to load the model manually: Component ID location

sunr4y commented 1 week ago

Optimization Guide On Device Model is missing for me too.

@lightning-joyce , could you please share the component ID for Optimization Guide On Device Model from chrome://components/ - this might help us to load the model manually: Component ID location

`

Optimization Guide On Device Model - Version: 2024.6.5.2205
      </div>`

I have the same problem but I  managed to get the option in my windows server, however I can't run it because no GPU 🙃
VineshReddy commented 1 week ago

Click check for update on all the options in chrome://components/ from start to end, this somehow worked and showed optimization-guide-on-device-model, which then needs to be updated.

and restart