Deploying choronos in Amazone Sagemaker - Error saying 'amazon/chronos-t5-large' is the correct path to a directory containing all relevant files for a T5TokenizerFast tokenizer

#4
by Shemnab - opened

Hi,

I have been to trying to get the Chonos-t5-tiny deployed in Sagemaker. I keep getting the error
OSError: Can't load tokenizer for 'amazon/chronos-t5-large'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'amazon/chronos-t5-large' is the correct path to a directory containing all relevant files for a T5TokenizerFast tokenizer.

Could someone please help on this?

Thanks,
Shemna

Amazon Web Services org

Hi Shemna,

Thank you for your interest.

Chronos is not a text LLM, so it doesn't actually have an associated T5TokenizerFast. At the moment, you won't be able to deploy Chronos to Sagemaker in a one-click fashion (with only supports text LLMs currently). You can either test Chronos locally or manually setup a Sagemaker endpoint. However, soon you should be able to one-click deploy Chronos using AutoGluon cloud.

cc @canerturkmen

Amazon Web Services org
edited 23 days ago

As @abdulfatir mentioned, AutoGluon Cloud will soon add support for Sagemaker deployment in a few lines of codes. Before that, if you would like to test or prototype this, you can try with unofficial docker images at DockerHub

Below are sample codes with AG-Cloud to make it work:

import pandas as pd
from autogluon.cloud import TimeSeriesCloudPredictor
import os
from datetime import datetime
 
data = pd.read_csv("https://autogluon.s3.amazonaws.com/datasets/cloud/timeseries_train.csv")
id_column="item_id"
timestamp_column="timestamp"
target="target"
 
predictor_init_args = {
    "target": target
}  # init args you would pass to AG TimeSeriesCloudPredictor
predictor_fit_args = {
    "train_data": data,
    "time_limit": 600,
    "presets": "chronos_small",
}  # fit args you would pass to AG TimeSeriesCloudPredictor
cloud_predictor = TimeSeriesCloudPredictor(cloud_output_path="<s3://your_s3_path>")
cloud_predictor.fit(
    predictor_init_args=predictor_init_args,
    predictor_fit_args=predictor_fit_args,
    id_column=id_column,
    timestamp_column=timestamp_column,
    instance_type="ml.g4dn.2xlarge",
    custom_image_uri="<your_training_ecr_image_path>"
 
cloud_predictor.deploy(
    custom_image_uri="<your_inference_ecr_image_path>"
)
result = cloud_predictor.predict_real_time(
    test_data=data,
    id_column=id_column,
    timestamp_column=timestamp_column,
    target=target
)
print(result)

To ensure above codes working, you need following:

  • pip install autogluon.cloud in your Python env
  • Pull and push the training image from dockerhub to the AWS ECR account. Details on how to do that can be found at here
  • Pull and push the inference image to AWS ECR following the same procedure as above step
  • Replace <s3://your_s3_path>, <your_training_ecr_image_path>, <your_inference_ecr_image_path> in above codes with your own parameters

Let me know if you have any further questiokns

Sign up or log in to comment