curiosity-ai/catalyst

Allow loading models from a given stream

Closed this issue · 3 comments

Hi !

Right now loading models for the various algorithms is handled via the IStorage interface, which handles versioning etc..
However a common case at least for us is that we already have a storage abstraction in place, which cannot be used to implement the full IStorage interface ( so bridging is a non option )

For reading only would it be possible to add the option to read models from a stream directly ? Versioning etc would be handled on our side then..

Another issue that came up is, that the whole implicity usage of a global singleton IStorage interface is very bad at least in a server scenario ... Is there a way to load some models from one IStorage and others from a different one ?

Absolutely agreed - it's something that has been on my backlog for a while, also to enable removing the external dependency on our Mosaik.Core NuGet package.

For the singleton issue - I need to see what would be the cleanest way to change it - might be possible to just pass an optional IStorage implementation to the methods that load models from storage.
I'm also tempted to move the base models distribution to use NuGet packages - what do you think?

@BernhardGlueck finally got some time to work on this. Most models now support a LoadAsync and StoreAsync.
There is still a couple pending but will get back to it soon.

I'm also switching our model distribution to nuget, and splitting it by language - will update the samples soon enough with the new code!