-
Couldn't load subscription status.
- Fork 560
Open
Description
This issue tracks two code quality improvements for gemma/model.py to enhance maintainability and API clarity.
1. Redundant Code in Linear and Embedding Classes
- Problem: The
LinearandEmbeddingclasses contain nearly identical boilerplate code for handling quantized weights. This violates the DRY (Don't Repeat Yourself) principle. - Proposed Solution: Refactor this shared logic into a new
QuantizedWeightbase class. This will make the code cleaner, more modular, and easier to maintain.
2. Unused kv_write_indices Parameter
- Problem: The
GemmaForCausalLM.forwardmethod accepts akv_write_indicesparameter that is immediately overwritten byinput_positions. The passed argument is never used. - Proposed Solution: Remove this redundant parameter from the method signature to clean up the API and avoid confusion for developers.
These changes will improve the overall code quality and maintainability without altering the model's functionality.
Metadata
Metadata
Assignees
Labels
No labels