Time Series Prediction

I would like to predict a time series via TimeSeriesTransformerForPrediction described here: Time Series Transformer but I only got past_values and future_values and I get the error:

TypeError: forward () missing 4 required positional arguments: ‘past_time_features’, ‘past_observed_mask’, ‘static_categorical_features’, and ‘static_real_features’

Where am I wrong?

This is the code :

import torch
import torch.nn as nn

x_train = torch.from_numpy(x_train).type(torch.Tensor)
x_test = torch.from_numpy(x_test).type(torch.Tensor)
y_train = torch.from_numpy(y_train).type(torch.Tensor)
y_test = torch.from_numpy(y_test).type(torch.Tensor)

from transformers import TimeSeriesTransformerForPrediction

model = TimeSeriesTransformerForPrediction.from_pretrained(



# during training, one provides both past and future values

# as well as possible additional features

outputs = model(









loss = outputs.loss


it looks like all of the columns mentioned in the error message have to be provided, have you tried providing some dummy values like in batch example?