# --- Imports libs --- import gradio as gr import pandas as pd # --- Imports modules --- from modules.module_languageModel import LanguageModel # --- Imports interfaces --- from interfaces.interface_sesgoEnFrases import interface as interface_sesgoEnFrases from interfaces.interface_crowsPairs import interface as interface_crowsPairs # --- Tool config --- LANGUAGE_MODEL = "bert-base-multilingual-uncased" LANGUAGE = "english" # [english] AVAILABLE_LOGS = True # [True | False] # --- Init classes --- bert_lm = LanguageModel( model_name=LANGUAGE_MODEL ) # --- Init Vars --- labels = pd.read_json(f"language/{LANGUAGE}.json")["app"] # --- Init App --- INTERFACE_LIST = [ interface_sesgoEnFrases( language_model=bert_lm, available_logs=AVAILABLE_LOGS, lang=LANGUAGE), interface_crowsPairs( language_model=bert_lm, available_logs=AVAILABLE_LOGS, lang=LANGUAGE), ] TAB_NAMES = [ labels["phraseExplorer"], labels["crowsPairsExplorer"] ] iface = gr.TabbedInterface( interface_list=INTERFACE_LIST, tab_names=TAB_NAMES ) iface.queue(concurrency_count=8) iface.launch(debug=False)