from CODE.PPLUIE.config import model_dict import gradio as gr def show_available_llms(): chaine = "" for k in model_dict.keys(): chaine+="\t"+ k + "\n" return f"Available models with ParaPLUIE: \n\n{chaine}" with gr.Blocks() as demo: gr.Markdown( """ # W.I.P """) gr.Markdown( """ # ParaPLUIE (Paraphrase Generation Evaluation Powered by an LLM) ParaPLUIE is a metric for evaluating the semantic proximity of two sentences. ParaPLUIE use the perplexity of an LLM to compute a confidence score. It has shown the highest correlation with human judgement on paraphrase classification meanwhile reamin the computional cost low as it roughtly equal to one token generation cost. """) text_box = gr.Textbox(show_available_llms(), show_label=False) # with gr.Row(): # gr.Textbox(placeholder="Have you ever seen a tsunami ?", label="Source") # gr.Textbox(placeholder="Have you ever seen a tiramisu ?", label="Hypothesis") with gr.Row(): with gr.Column(scale=3): text1 = gr.Textbox(placeholder="Have you ever seen a tsunami ?", label="Source") text2 = gr.Textbox(placeholder="Have you ever seen a tiramisu ?", label="Hypothesis") with gr.Column(scale=1): btn1 = gr.Button("Compute") score = gr.Textbox(label="Score") demo.launch()