muellerzr's picture
muellerzr HF staff
Whelp let's try this!
e12b49b
raw
history blame
778 Bytes
# Launch AIM
import subprocess
import os
from huggingface_hub import hf_hub_download
import gradio as gr
PORT = 3000
HOST = "localhost"
REPO_ID = "muellerzr/bert-base-cased-tpu-accelerate-experiments"
def download_logs():
filename = "aim_logs.zip"
_ = hf_hub_download(
repo_id=REPO_ID,
repo_type="model",
filename=filename,
)
subprocess.run("unzip aim_logs.zip")
def run_aim():
cmd = f"aim up --repo aim_logs --host {HOST} --port {PORT}"
os.spawnl(os.P_DETACH, cmd)
html = f"""
<iframe src="https://{HOST}:{port}"></iframe>
"""
def run():
download_logs()
run_aim()
def main():
demo = gr.Interface(
fn=run,
outputs=gr.HTML(html)
)
demo.launch()
if __name__ == "__main__":
main()