CoolFace
Apppublic

EmbodiedAgentInterface/backend

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes
app.py47 linesDownload Raw Back to root
1from src.logging import configure_root_logger2configure_root_logger()3 4import logging5 6import gradio as gr7from main_backend_lighteval import run_auto_eval8from src.display.log_visualizer import log_file_to_html_string9from src.display.css_html_js import dark_mode_gradio_js10from src.envs import REFRESH_RATE, REPO_ID, QUEUE_REPO, RESULTS_REPO11from src.logging import setup_logger12 13logging.basicConfig(level=logging.INFO)14logger = setup_logger(__name__)15 16 17intro_md = f"""18# Intro19This is just a visual for the auto evaluator. 20 21# Important links22| Description     | Link |23|-----------------|------|24| Leaderboard     | [{REPO_ID}](https://huggingface.co/spaces/{REPO_ID}) |25| Queue Repo      | [{QUEUE_REPO}](https://huggingface.co/datasets/{QUEUE_REPO}) |26| Results Repo    | [{RESULTS_REPO}](https://huggingface.co/datasets/{RESULTS_REPO}) |27 28# Logs29Note that the lines of the log visual are reversed.30"""31 32def button_auto_eval():33    logger.info("Manually triggering Auto Eval")34    run_auto_eval()35 36with gr.Blocks(js=dark_mode_gradio_js) as demo:37    with gr.Tab("Application"):38        gr.Markdown(intro_md)39        output = gr.HTML(log_file_to_html_string, every=1)40        dummy = gr.Markdown(run_auto_eval, every=REFRESH_RATE, visible=False)41 42        # Add a button that when pressed, triggers run_auto_eval43        button = gr.Button("Manually Run Evaluation")44        button.click(fn=button_auto_eval, inputs=[], outputs=[])45 46if __name__ == '__main__':47    demo.queue(default_concurrency_limit=40).launch(server_name="0.0.0.0", show_error=True, server_port=7860)