muellerzr HF staff commited on
Commit
e12b49b
1 Parent(s): 5f98427

Whelp let's try this!

Browse files
Files changed (2) hide show
  1. app.py +44 -0
  2. requirements.txt +1 -0
app.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Launch AIM
2
+
3
+ import subprocess
4
+ import os
5
+ from huggingface_hub import hf_hub_download
6
+ import gradio as gr
7
+
8
+ PORT = 3000
9
+ HOST = "localhost"
10
+
11
+ REPO_ID = "muellerzr/bert-base-cased-tpu-accelerate-experiments"
12
+
13
+ def download_logs():
14
+ filename = "aim_logs.zip"
15
+ _ = hf_hub_download(
16
+ repo_id=REPO_ID,
17
+ repo_type="model",
18
+ filename=filename,
19
+ )
20
+ subprocess.run("unzip aim_logs.zip")
21
+
22
+ def run_aim():
23
+ cmd = f"aim up --repo aim_logs --host {HOST} --port {PORT}"
24
+ os.spawnl(os.P_DETACH, cmd)
25
+
26
+ html = f"""
27
+ <iframe src="https://{HOST}:{port}"></iframe>
28
+ """
29
+
30
+ def run():
31
+ download_logs()
32
+ run_aim()
33
+
34
+ def main():
35
+ demo = gr.Interface(
36
+ fn=run,
37
+ outputs=gr.HTML(html)
38
+ )
39
+
40
+ demo.launch()
41
+
42
+ if __name__ == "__main__":
43
+ main()
44
+
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ aim==3.12.2