Update README.md
Browse files
README.md
CHANGED
@@ -41,14 +41,9 @@ model = AutoModelForCausalLM.from_pretrained('thuml/timer-base-84m', trust_remot
|
|
41 |
batch_size, lookback_length = 1, 2880
|
42 |
seqs = torch.randn(batch_size, lookback_length)
|
43 |
|
44 |
-
# normalize the input to mitigate different scale
|
45 |
-
mean, std = seqs.mean(dim=-1, keepdim=True), seqs.std(dim=-1, keepdim=True)
|
46 |
-
normed_seqs = (seqs - mean) / std
|
47 |
-
|
48 |
# generate forecast
|
49 |
prediction_length = 96
|
50 |
-
|
51 |
-
output = std * normed_output + mean # rescale the output to the original scale
|
52 |
|
53 |
print(output.shape)
|
54 |
```
|
|
|
41 |
batch_size, lookback_length = 1, 2880
|
42 |
seqs = torch.randn(batch_size, lookback_length)
|
43 |
|
|
|
|
|
|
|
|
|
44 |
# generate forecast
|
45 |
prediction_length = 96
|
46 |
+
output = model.generate(seqs, max_new_tokens=prediction_length)
|
|
|
47 |
|
48 |
print(output.shape)
|
49 |
```
|