@@ -78,9 +78,9 @@ import torch
78
78
from chronos import ChronosPipeline
79
79
80
80
pipeline = ChronosPipeline.from_pretrained(
81
- " amazon/chronos-t5-small" ,
82
- device_map = " cuda" , # use "cpu" for CPU inference and "mps" for Apple Silicon
83
- torch_dtype = torch.bfloat16,
81
+ " amazon/chronos-t5-small" ,
82
+ device_map = " cuda" , # use "cpu" for CPU inference and "mps" for Apple Silicon
83
+ torch_dtype = torch.bfloat16,
84
84
)
85
85
86
86
df = pd.read_csv(" https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv" )
@@ -89,9 +89,9 @@ df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnal
89
89
# or a left-padded 2D tensor with batch as the first dimension
90
90
# forecast shape: [num_series, num_samples, prediction_length]
91
91
forecast = pipeline.predict(
92
- context = torch.tensor(df[" #Passengers" ]),
93
- prediction_length = 12 ,
94
- num_samples = 20 ,
92
+ context = torch.tensor(df[" #Passengers" ]),
93
+ prediction_length = 12 ,
94
+ num_samples = 20 ,
95
95
)
96
96
```
97
97
@@ -130,9 +130,9 @@ import torch
130
130
from chronos import ChronosPipeline
131
131
132
132
pipeline = ChronosPipeline.from_pretrained(
133
- " amazon/chronos-t5-small" ,
134
- device_map = " cuda" ,
135
- torch_dtype = torch.bfloat16,
133
+ " amazon/chronos-t5-small" ,
134
+ device_map = " cuda" ,
135
+ torch_dtype = torch.bfloat16,
136
136
)
137
137
138
138
df = pd.read_csv(" https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv" )
0 commit comments