# Launch AIM import subprocess import os from huggingface_hub import hf_hub_download import gradio as gr import time PORT = 3000 HOST = "127.0.0.1" REPO_ID = "muellerzr/bert-base-cased-tpu-accelerate-experiments" def download_logs(): filename = "aim_logs.zip" f = hf_hub_download( repo_id=REPO_ID, repo_type="model", filename=filename, ) subprocess.run(f'mv {f} .') subprocess.run("unzip aim_logs.zip") def run_aim(): cmd = f"aim up --repo aim_logs --host {HOST} --port {PORT}".split() subprocess.Popen(cmd) html = f""" """ def run(): download_logs() run_aim() time.sleep(5) def main(): demo = gr.Interface( fn=run, inputs=[], outputs=gr.HTML(html), ) demo.launch() if __name__ == "__main__": main()