Add Gemma 4 E4B offline model and generalize offline-model handling#75
Closed
Android-PowerUser wants to merge 1 commit intoadd-mistral-medium-latest-with-retry-logicfrom
Closed
Conversation
Contributor
There was a problem hiding this comment.
This PR successfully refactors the codebase to support multiple offline models by introducing the isOfflineModel property to the ModelOption enum. The changes are well-structured and maintain consistency across all affected files. The refactoring properly abstracts offline model handling and adds support for a new GEMMA_4_E4B_IT model alongside the existing GEMMA_3N_E4B_IT.
Key improvements:
- Added
isOfflineModelandofflineModelFilenameproperties toModelOptionenum - Replaced all hardcoded model name checks with the generic
isOfflineModelproperty check - Updated
ModelDownloadManagerAPI to acceptModelOptionparameter for better flexibility - Added proper size information for the new GEMMA 4 model
The changes follow clean code principles and maintain backward compatibility. No blocking issues found.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Unknown model type: tf_lite_end_of_vision) kann bei bestimmten LiteRT-Modellen auftreten und ist zur Laufzeit relevant, löst aber hier keine Kompilationsänderung aus.Description
GEMMA_4_E4B_IThinzugefügt undModelOptionum FelderisOfflineModelundofflineModelFilenameerweitert, damit Offline-Modelle dateigenspezifisch konfiguriert werden (GenerativeAiViewModelFactory.kt).isOfflineModelumgestellt (Änderungen inMenuScreen.kt,PhotoReasoningScreen.kt,PhotoReasoningViewModel.ktundScreenOperatorAccessibilityService.kt).ModelDownloadManagerrefactored, um modellabhängige Dateinamen, Temp-Dateien und download/resume/cancel APIs zu unterstützen (ModelDownloadManager.kt), inklusive Benachrichtigungs-/Fortschrittslogik.Testing
sdkmanager(Android SDK cmdline tools, platform-tools,platforms;android-35,build-tools;35.0.0) um lokale Kompilationsprüfung zu ermöglichen.local.propertiesmitsdk.dir=/opt/android-sdkund eine minimal ersetzendeapp/google-services.jsonangelegt, damit Gradle-Tasks laufen../gradlew :app:compileDebugKotlinund die Aufgabe lief bis zuBUILD SUCCESSFULdurch (nur Compiler-Warnungen, keine Fehler).Unknown model type: tf_lite_end_of_vision) wurde nicht zur Laufzeit reproduziert oder gelöst, da er ein Modell-/Runtime-Kompatibilitätsproblem ist und nicht Teil der Kompilations-/Integrationsarbeiten war.Codex Task