The paper proposes an approach to predict the temperature in the rooms of a public building. The model of the building is described by the average temperatures in its rooms, the characteristics of external walls and heating elements. Weather conditions are determined by the temperature, speed and direction of the wind. The state of the thermal unit is described by the temperature of heat agent at the inlet and outlet of a heat supply system, as well as the flow rate. To build a predictive model, it is necessary to identify a nonlinear dependence of the temperature inside the room on these parameters. This problem is solved using a recurrent artificial neural network. The network based on gated recurrent unit was selected as the base for the network architecture in this approach. The features of this structure allow to take into account the sequence of data without using excessive parameters. To train the model and predict temperature values, measurement sequences of different lengths were used to determine the most effective model. The number of blocks corresponds to the length of the time series. The state of the network on the last block is a predicted temperature.