I would recommend checking with the code author to get more instructions on how to use and add the code.
It wouldn’t be a theme-related process so if the author can provide a solution for the default Twenty series WP theme, the exact method would work in GeneratePress.