Simplify and clean up model loading system in deepaas/model/__init__.py - #201
Simplify and clean up model loading system in deepaas/model/__init__.py#201alvarolopez with Copilot wants to merge 44 commits into
Conversation
This requires that we change all model args/responses from Marshmallow to Pydantic. Most of the code is in this change, we can split it later on two different changes (marshmallow + pydantic and FastAPI for predict).
After checking with people using the package for a while, the training methods were not used at all, therefore we are now removing the training endpoints. This also allows us to have a much more simple codebase.
Co-authored-by: alvarolopez <468751+alvarolopez@users.noreply.github.com>
Co-authored-by: alvarolopez <468751+alvarolopez@users.noreply.github.com>
Co-authored-by: alvarolopez <468751+alvarolopez@users.noreply.github.com>
|
@copilot the code that we used to manage the models and the model names, the registration, etc. can be improved, as we do not have to manage more than one single model now. |
…_init__.py Co-authored-by: alvarolopez <468751+alvarolopez@users.noreply.github.com>
f0df6de to
471eb1a
Compare
… with MODELS dictionary Co-authored-by: alvarolopez <468751+alvarolopez@users.noreply.github.com>
… V2_MODELS access Co-authored-by: alvarolopez <468751+alvarolopez@users.noreply.github.com>
|
@copilot I think you are using an outdated branch. Please rebase. |
deepaas/model/__init__.py…ry complexity Co-authored-by: alvarolopez <468751+alvarolopez@users.noreply.github.com>
Rebased successfully from master branch and simplified the model management approach. The code now uses the current master branch as the base and implements a cleaner single model pattern as requested. All tests passing. Changes in commit 54d3439.
I've simplified the model management code to handle only a single model as requested. Removed the dictionary-based |
|
|
@copilot I think you are using an outdated branch. Please rebase against |



This PR simplifies and cleans up the model loading system in
deepaas/model/__init__.pyto better match the single model use case and removes unnecessary complexity.Changes Made
Legacy Code Removed
FIXME(aloga): this is extremely uglyload_v2_model()function with a cleanerregister_v2_models(app)functionSimplified Implementation
MODELandMODEL_NAMEvariables instead of dictionary-based approach, since DEEPaaS only handles one model at a timeregister_models()function to handle single model without unnecessary complexityV2_MODELandV2_MODEL_NAMEV2_MODELSdictionary interface through__getattr__for API code that expects itBackwards Compatibility
The changes maintain full backwards compatibility:
model.V2_MODELandmodel.V2_MODEL_NAMEcontinues to work unchangedmodel.V2_MODELSdictionary interface still worksBefore/After Comparison
Before (overcomplicated dictionary approach):
After (simplified single model):
Testing
This simplification removes unnecessary complexity while maintaining full functionality and better matching the actual single model use case.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.