operatorai / modelstore

🏬 modelstore is a Python library that allows you to version, export, and save a machine learning model to your filesystem or a cloud storage provider.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Custom Model Managers

erosenthal-square opened this issue · comments

It'd be cool to be able to subclass ModelManager so that I can write custom ones (I'm working on a project with a custom model class). While it's easy to subclass right now, there's no easy way to add a custom ModelManager to ModelStore. So, some method like model_store.register_model_manager(my_custom_manager) would be nice.

Hmm actually after writing the above, I realize I could just append my custom class to model_store._managers which is a bit hacky but feasible. Anywho, I'll leave this issue up as food for thought!

That's a cool idea! I've added it to my list of things to look into. Is this for an in-house library, or an ML library that is just not supported by modelstore yet?

One thing that modelstore already has is a way of saving "models" that are just paths (PosixPath or str - and just files, not directories). Something like:

# Your own code
model = train_my_custom_model()
model_path = save_custom_model(model)

# Upload by pointing to the file
meta_data = model_store.upload(_DOMAIN_NAME, model=model_path)

But model_store.load() cannot work with this approach 😕 , so registering a custom manager could be a great alternative

Yeah, this is for an in-house library. Uploading the serialized model file is a great solution. While load() doesn't work, download() does which is perfectly fine for now!