awslabs / gluonts

Probabilistic time series modeling in Python
https://ts.gluon.ai
Apache License 2.0
4.41k stars 740 forks source link

Add support for Amazon S3 URI in predictor serialization #3171

Open juliangrueber opened 1 month ago

juliangrueber commented 1 month ago

Description

The serialisation of the predictor expects a Path from Pathlib: https://github.com/awslabs/gluonts/blob/b63fc05eade0069a1681a6cc40ff016e5b466a19/src/gluonts/model/predictor.py#L78-L80

Passing an S3 URI causes the method to fail. The reason is the usage of Pathlib


from pathlib import Path
Path("s3://my-bucket") / "my_file"

results in PosixPath('s3:/my-bucket/my_file')

I'm using AutuGluon on SageMaker Studio where I am limited in disk size and I want to track all my experiments on Amazon S3. Storing everything on S3, I easily can access the Tensorflow board without using SageMaker Studio. Therefore, it would be great if this method would also support S3 URIs.

CC: @shchur