import gradio as gr from src.nlp_circle_demo.interface import GradioElementWrapper GradioElementWrapper.interface_from_yaml("resources/qa_interface.yml") robertaGer = GradioElementWrapper.interface_from_yaml( "resources/legal_german_roberta_interface.yml" ).gradio_element gbert = GradioElementWrapper.interface_from_yaml( "resources/gbert_interface.yml" ).gradio_element ner = GradioElementWrapper.interface_from_yaml( "resources/ner_interface.yml" ).gradio_element zeroShot = GradioElementWrapper.interface_from_yaml( "resources/zero_shot_interface.yml" ).gradio_element legalInterface = gr.TabbedInterface([robertaGer, gbert], ["Roberta Legal", "Bert"]) qaInterface = GradioElementWrapper.interface_from_yaml( "resources/qa_interface.yml" ).gradio_element simplicationInterface = GradioElementWrapper.interface_from_yaml( "resources/simplification_interface.yml" ).gradio_element gptInterface = GradioElementWrapper.interface_from_yaml( "resources/gpt2_interface.yml" ).gradio_element summarizationInterface = GradioElementWrapper.interface_from_yaml( "resources/summarization_interface.yml" ).gradio_element demo = gr.TabbedInterface( [ gptInterface, legalInterface, qaInterface, summarizationInterface, simplicationInterface, ner, zeroShot, ], [ "GPT", "Legal", "Question Answering", "Summarization", "Simplification", "Named Entity Recognition", "Zero-Shot-Klassifizierung", ], ) demo.launch()