|
import os |
|
import gradio as gr |
|
from functools import partial |
|
import re |
|
from src.view.help_tab import create_help_tab |
|
from src.view.metric_view_tab import create_metric_view_tab |
|
from src.view.reverse_search_tab import create_reverse_search_tab |
|
from src.logic.data_fetching import fetch_datasets, fetch_groups, fetch_metrics, reverse_search, reverse_search_add |
|
|
|
METRICS_LOCATION_DEFAULT = os.getenv("METRICS_LOCATION_DEFAULT", "hf://datasets/HuggingFaceFW-Dev/summary-stats-files") |
|
|
|
def create_interface(): |
|
with gr.Blocks() as demo: |
|
metrics_headline = gr.Markdown(value="# Metrics Exploration") |
|
available_datasets = gr.State([]) |
|
selected_datasets = gr.State([]) |
|
|
|
with gr.Tabs(): |
|
with gr.Tab("Help"): |
|
create_help_tab() |
|
|
|
with gr.TabItem("Metric View"): |
|
base_folder = create_metric_view_tab(METRICS_LOCATION_DEFAULT, available_datasets, selected_datasets) |
|
|
|
with gr.TabItem("Reverse Metrics Search"): |
|
create_reverse_search_tab(base_folder, available_datasets, selected_datasets) |
|
|
|
return demo |