-
Notifications
You must be signed in to change notification settings - Fork 15
Simplify and clean up model loading system in deepaas/model/__init__.py #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify and clean up model loading system in deepaas/model/__init__.py #201
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 <[email protected]>
Co-authored-by: alvarolopez <[email protected]>
Co-authored-by: alvarolopez <[email protected]>
@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 <[email protected]>
f0df6de
to
471eb1a
Compare
… with MODELS dictionary Co-authored-by: alvarolopez <[email protected]>
… V2_MODELS access Co-authored-by: alvarolopez <[email protected]>
@copilot I think you are using an outdated branch. Please rebase. |
deepaas/model/__init__.py
…ry complexity Co-authored-by: alvarolopez <[email protected]>
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__.py
to better match the single model use case and removes unnecessary complexity.Changes Made
Legacy Code Removed
FIXME(aloga): this is extremely ugly
load_v2_model()
function with a cleanerregister_v2_models(app)
functionSimplified Implementation
MODEL
andMODEL_NAME
variables instead of dictionary-based approach, since DEEPaaS only handles one model at a timeregister_models()
function to handle single model without unnecessary complexityV2_MODEL
andV2_MODEL_NAME
V2_MODELS
dictionary interface through__getattr__
for API code that expects itBackwards Compatibility
The changes maintain full backwards compatibility:
model.V2_MODEL
andmodel.V2_MODEL_NAME
continues to work unchangedmodel.V2_MODELS
dictionary 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.