-
Notifications
You must be signed in to change notification settings - Fork 15
Feat/mlflow models from code migration classification with svm #267
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
Merged
ata-turhan
merged 12 commits into
v2.0.0
from
feat/mlflow-models-from-code-migration-classification-with-svm
Nov 3, 2025
Merged
Feat/mlflow models from code migration classification with svm #267
ata-turhan
merged 12 commits into
v2.0.0
from
feat/mlflow-models-from-code-migration-classification-with-svm
Nov 3, 2025
+598
−2,601
Conversation
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
…oach - Replace legacy IrisFlowerModel(mlflow.pyfunc.PythonModel) with models-from-code pattern - Extract business logic to pure Model class in src/mlflow/model.py - Add MLflow integration layer with loader.py and logger.py - Update notebook to use new Logger.log_model approach - Add dataset_url to config.yaml for model initialization - Update MLflow dependency to 3.1.0 to support models-from-code - Create complete src/ package structure with utilities - Eliminate MLflow serialization issues through architectural separation
…at/mlflow-models-from-code-migration-classification-with-svm
…ith-svm' of https://github.com/HPInc/AI-Blueprints into feat/mlflow-models-from-code-migration-classification-with-svm
d533d7e to
9a605e3
Compare
…ification-with-svm
for more information, see https://pre-commit.ci
ata-turhan
approved these changes
Oct 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 🚀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
Improvements to existing features
python
Pull requests that update python code
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.
MLflow 3.1.0 Models-from-Code Migration for Classification with SVM
Overview
Successfully migrated the Classification with SVM blueprint from MLflow's legacy serialization-based model logging (
python_model) to the modern models-from-code approach (loader_module+data_path). This comprehensive architectural refactoring resolves critical MLflow 3.1.0 compatibility issues, particularly theAttributeError: 'llama_context_params' object has no attribute 'seed'serialization error with llama-cpp-python, while maintaining complete API compatibility and improving code architecture.Summary of Changes
✅ Universal Structure Standardization (Latest Update)
This blueprint now follows the universal AI-Blueprints structure pattern established in PR #208:
New Standardized Architecture
Universal Loader & Logger Synchronization
loader.pyandlogger.py: Exact copies from PR feat: [GEN-AI] MLflow 3.1.0 Models-from-Code Migration for Vanilla RAG Blueprint #208 (Vanilla-RAG blueprint)Logger.log_model(signature, ...)src.mlflow.loaderModelandLogger(no blueprint prefixes)Technical Changes
New Architecture Components
src/mlflow/model.py(UPDATED - Generic Class Names)class Model(removed blueprint-specific prefixes)predict(model_input, params)API signature for backward compatibilitysrc/mlflow/loader.py(SYNCHRONIZED - Canonical Implementation)_load_pyfunc()functionModelinstance for predictionsrc/mlflow/logger.py(SYNCHRONIZED - Canonical Implementation)signatureas first parameter:Logger.log_model(signature, ...)class Logger(removed blueprint-specific prefixes)src/mlflow/__init__.py(SYNCHRONIZED - Canonical Implementation)ModelandLoggerwith lazy loadingNotebook & Signature Updates
Enhanced Signature Handling
Following PR #208 pattern, signature creation now occurs in the notebook:
Configuration & Environment Changes
Configuration Updates
config.yaml: Added explicitmodel_pathconfiguration for local model file specificationmlflow==3.1.0for compatibilityUtility Function Enhancements
get_model_path(): Enhanced utility function for container-aware model path resolutionMODEL_ARTIFACTS_PATHImplementation Details
Architecture Impact
Logger(MLflow integration only)Model(framework-agnostic core evaluation functionality)loader(MLflow deployment interface)Code Organization
src/mlflow/package with universal MLflow integration architecturemodel.py,loader.py,logger.py(no blueprint prefixes)Error Resolution Strategy
Testing Strategy
Manual Testing
Quality Assurance
Code Quality
Performance Impact
Review Guidelines
Critical Review Areas
loader.pycorrectly implements models-from-code patternModel.predict()maintains identical signature and behaviorTesting Instructions
notebooks/register-model.ipynbto validate new logging approachDeployment Considerations
MODEL_ARTIFACTS_PATHenvironment variable is configured in deployment containersEvidence
📋 Migration Validation Report:
iris-flower-classifier-streamlit-ui.pdf
Commit History Summary
The development progression demonstrates systematic architectural migration and universal structure adoption:
EvaluationModelwith full classification with SVM functionalityEvaluationServiceto pure registration responsibilitiesBreaking Changes
None - This migration maintains complete API compatibility:
Future Considerations
Technical Debt Resolution
Blueprint Migration Template
This implementation provides a reusable migration pattern for other AI blueprints:
src/mlflow/with generic filenamesloader.pyandlogger.pyfrom PR feat: [GEN-AI] MLflow 3.1.0 Models-from-Code Migration for Vanilla RAG Blueprint #208Modelclass without MLflow inheritanceLogger.log_model(signature, ...)src.mlflow.loadermodule pathPrinted Page for Streamlit Web App:
Streamlit for Classification with SVM.pdf