sjwhitworth/golearn

Saving model outside filesystem

michaelbironneau opened this issue · 1 comments

The current model Save() feature stores models to a file with the given filename. Would it be possible to support a slightly different interface that takes an io.Writer to save or io.Reader to load? This would enable use cases such as saving models to S3 buckets or databases without having to go via the filesystem first.

Happy to work on a PR if you'd consider it.

Yeah, I think this would be a good idea (apart from if S3 flakes out after training a model for a long time). It might have to be an io.WriteSeeker or io.ReadSeeker though because some of the serialization formats may require that.