Recently, time series forecasting modelling in the Consumer Price Index (CPI) has attracted the attention of the scientific community. Several research projects have tackled the problem of CPI prediction for their countries using statistical learning, machine learning and deep neural networks. The most popular approach to CPI in several countries is the Autoregressive Integrated Moving Average (ARIMA) due to the nature of the data. This paper addresses the Cuban CPI forecasting problem using Transformer with attention model over univariate dataset. The fine tuning of the lag parameter shows that Cuban CPI has better performance with small lag and that the best result was in p = 1. Finally, the comparative results between ARIMA and our proposal show that the Transformer with attention has a very high performance despite having a small data set.