From 3b159ae15ad6e2d19c51a28d3c9ac468896f8298 Mon Sep 17 00:00:00 2001 From: Abdul Fatir Ansari Date: Mon, 25 Mar 2024 12:13:31 +0000 Subject: [PATCH] Update README --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index dd7ae66..cae2891 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,9 @@ import torch from chronos import ChronosPipeline pipeline = ChronosPipeline.from_pretrained( - "amazon/chronos-t5-small", - device_map="cuda", - torch_dtype=torch.bfloat16, + "amazon/chronos-t5-small", + device_map="cuda", + torch_dtype=torch.bfloat16, ) df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv") @@ -59,12 +59,12 @@ df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnal context = torch.tensor(df["#Passengers"]) prediction_length = 12 forecast = pipeline.predict( - context, - prediction_length, - num_samples=20, - temperature=1.0, - top_k=50, - top_p=1.0, + context, + prediction_length, + num_samples=20, + temperature=1.0, + top_k=50, + top_p=1.0, ) # forecast shape: [num_series, num_samples, prediction_length] # visualize the forecast @@ -90,9 +90,9 @@ import torch from chronos import ChronosPipeline pipeline = ChronosPipeline.from_pretrained( - "amazon/chronos-t5-small", - device_map="cuda", - torch_dtype=torch.bfloat16, + "amazon/chronos-t5-small", + device_map="cuda", + torch_dtype=torch.bfloat16, ) df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv") @@ -100,7 +100,7 @@ df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnal # context must be either a 1D tensor, a list of 1D tensors, # or a left-padded 2D tensor with batch as the first dimension context = torch.tensor(df["#Passengers"]) -embeddings, decoding_context = pipeline.embed(context) +embeddings, tokenizer_state = pipeline.embed(context) ```