import gradio as gr import os from utils import generate_response, emb2info, pre_prompt, get_embedding os.environ['NO_PROXY'] = '127.0.0.1' print(os.getcwd()) def predict(user_input, history=[]): # tokenize the new input sentence emb_user = get_embedding(user_input) info_to_add, retrieval_text = emb2info(emb_user) response = generate_response(pre_prompt + info_to_add + \ "\n \n User : " + user_input + "\n Chat bot :") history.append((user_input,response)) #response = [(user_input,response)] return history, history with gr.Blocks() as app: gr.Markdown( "## Bienvenue sur l'interface demo de SARA " ) logo_URL = "file/static/logo_sara.png" image = "