Refactor and Restructure loader.weights and core Packages
Summary
To improve project maintainability and readability, a refactor of two key packages: loader.weights and core is proposed. More specifically:
1. Move loader.weights into the model package
The current separation introduces unnecessary indirection. Consolidating these classes under model better reflects their role and simplifies the structure.
Proposed Changes:
- Move
loader.weights.ModelLoader → model.loader.ModelLoader
- Move
loader.weights.State → model.State,
- Move
loader.weights.Weights → model.Weights
2. Full Refactor of the core Package
The core package currently combines low-level data structures. The naming is vague and could be improved for better clarity and cohesion.
Proposed Actions:
- Rename the
core package to something more descriptive:
- Suggested options:
data, types, or tensors
- Restructure sub-packages and files accordingly:
model.tensor.* classes like FloatTensor, F16FloatTensor, etc. → data.tensor or types.tensor
GGUF, GGMLType → potentially under data.format or a similar grouping
Float16 → into data or types package
Pair → move to auxiliary package
Open Questions
- Should we adopt
data, types, or another name for the renamed core package?
- Are there any objections to merging
loader.weights into the model package?
Refactor and Restructure
loader.weightsandcorePackagesSummary
To improve project maintainability and readability, a refactor of two key packages:
loader.weightsandcoreis proposed. More specifically:1. Move
loader.weightsinto themodelpackageThe current separation introduces unnecessary indirection. Consolidating these classes under
modelbetter reflects their role and simplifies the structure.Proposed Changes:
loader.weights.ModelLoader→model.loader.ModelLoaderloader.weights.State→model.State,loader.weights.Weights→model.Weights2. Full Refactor of the
corePackageThe
corepackage currently combines low-level data structures. The naming is vague and could be improved for better clarity and cohesion.Proposed Actions:
corepackage to something more descriptive:data,types, ortensorsmodel.tensor.*classes likeFloatTensor,F16FloatTensor, etc. →data.tensorortypes.tensorGGUF,GGMLType→ potentially underdata.formator a similar groupingFloat16→ intodataortypespackagePair→ move toauxiliarypackageOpen Questions
data,types, or another name for the renamedcorepackage?loader.weightsinto themodelpackage?