I tried removing the .eval() and .train() but this did not work. I tried to isolate every piece and I conclude that this specific function that I call made the issue.
import matplotlib.pyplot as plt
from Preprocessing import preprocessing
import numpy as np
from rouge import Rouge
import os
import re
import string
from unicodedata import normalize
from Preprocessing import word2vec as w2v
import numpy as np
import keras
import tensorflow as tf
from matplotlib import pyplot as plt
import sys

#convert prediction into sentence
def make_sentence_one_by_one(prediction, ground_truth, target_reviews_length, tokenizer, role, count_predictions, rating_prediction, ground_truth_rating, print_sentence,max_review_length):

        if (print_sentence):
                print('\n\n\n\n\n\n --------------------',role,'--------------------')

        #print(ground_truth.shape)

        #initialize some properties
        target_str = ''
        predicted_str = ''
        
        rouge = Rouge()
        
        if (print_sentence):
                print('\n\n\n Sentence \n\n\n')

        
        count_words = 0 #keep track of the words
        if (print_sentence):
                print('\n ---------- Predicted ---------- \n')
                print('\n------ Rating prediction:',rating_prediction,'Ground truth rating:',ground_truth_rating,'------\n')
        for index_word in prediction:
        
                word = preprocessing.index_to_word_mapping(index_word, tokenizer)
                
                #if (word==None):
                #        print(index_word)

                #we are have two condition, the first one assumes that the model has learned when to stop 'speaking' and generates the word 'eos'
                #LIMITATIONS
                
                predicted_str = predicted_str+' '+str(word)     
                
                if (print_sentence):   
                        print(word,end =" ")        
                count_words+=1
                
                if( (word=='eos') or (count_words==max_review_length) ):
                
                        if (print_sentence):
                                print('   |----- end of sentence -----|   ')
                        break
                

                #otherwise for more readable results we stop when we met the lenght of the ground truth
                
                '''
                if ( (word=='eos') or (count_words == target_reviews_length[str(count_predictions)]) ):
                
                        print('   |----- end of sentence -----|   ')
                        break
                '''
                  
        if (print_sentence):
                print('\n ---------- Target ---------- \n\n')
        for word in ground_truth:
        
        
                word = preprocessing.index_to_word_mapping(word, tokenizer)
                target_str = target_str+' '+str(word)
                if (print_sentence):       
                        print(word,end =" ")
                
                if ( (word=='eos') ):
                
                        if (print_sentence):
                                print('   |----- end of sentence -----|   ')
                        break
                   
                        
        #print(target_str)
        #print(predicted_str)
        score = rouge.get_scores(predicted_str, target_str)

        if (print_sentence):
                print('\n ---------- Rouge score ---------- \n')
                print(score)

        #initialize again for the next prediction
        #target_str = ''
        #predicted_str = ''                        
                        
        if (print_sentence):        
                print('\n\n\n')
        
        #return only the rouge-1 f score
        return score[0]['rouge-1']['f']