cemigo mahnerak commited on
Commit
fe07d50
0 Parent(s):

Duplicate from aimstack/aim

Browse files

Co-authored-by: Mahnerak <[email protected]>

Files changed (4) hide show
  1. .gitattributes +35 -0
  2. Dockerfile +40 -0
  3. README.md +81 -0
  4. aim_repo.tar.gz +3 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ aim_repo.tar.gz filter=lfs diff=lfs merge=lfs -text
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:kinetic
2
+
3
+ # Doesn't usually have an "upgrade"
4
+ RUN apt-get update \
5
+ && DEBIAN_FRONTEND=noninteractive \
6
+ apt-get install --no-install-recommends --assume-yes \
7
+ build-essential \
8
+ python3 \
9
+ python3-dev \
10
+ python3-pip
11
+
12
+
13
+ RUN useradd -m -u 1000 aim_user
14
+
15
+ # Switch to the "aim_user" user
16
+ USER aim_user
17
+
18
+ # Set home to the user's home directory
19
+ ENV HOME=/home/aim_user \
20
+ PATH=/home/aim_user/.local/bin:$PATH
21
+
22
+ # Set the working directory to the user's home directory
23
+ WORKDIR $HOME
24
+
25
+ # install the `aim` package on the latest version
26
+ RUN pip install aim
27
+
28
+ RUN aim telemetry off
29
+
30
+ ENTRYPOINT ["/bin/sh", "-c"]
31
+
32
+ COPY aim_repo.tar.gz .
33
+ RUN tar xvzf aim_repo.tar.gz
34
+ # have to run `aim init` in the directory that stores aim data for
35
+ # otherwise `aim up` will prompt for confirmation to create the directory itself.
36
+ # We run aim listening on 0.0.0.0 to expose all ports. Also, we run
37
+ # using `--dev` to print verbose logs. Port 43800 is the default port of
38
+ # `aim up` but explicit is better than implicit.
39
+ CMD ["aim up --host 0.0.0.0 --port 7860 --workers 2"]
40
+
README.md ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Aim
3
+ emoji: 🔥
4
+ colorFrom: purple
5
+ colorTo: blue
6
+ sdk: docker
7
+ license: other
8
+ fullWidth: true
9
+ duplicated_from: aimstack/aim
10
+ ---
11
+
12
+ # Aim on Spaces
13
+
14
+ **Hugging Face Spaces** offer a simple way to host ML demo apps directly on your profile or your organization’s profile. This allows you to create your ML portfolio, showcase your projects at conferences or to stakeholders, and work collaboratively with other people in the ML ecosystem.
15
+ Hugging Face Spaces make it easy for you to create and deploy ML-powered demos in minutes.
16
+
17
+ Check out the [Hugging Face Spaces docs](https://huggingface.co/docs/hub/spaces-overview) to learn more about Spaces.
18
+
19
+ ## Deploy Aim on Spaces
20
+
21
+ You can deploy Aim on Spaces with a single click!
22
+
23
+ <a href="https://huggingface.co/new-space?template=aimstack/aim">
24
+ <img src="https://huggingface.co/datasets/huggingface/badges/raw/main/deploy-to-spaces-lg.svg" />
25
+ </a>
26
+
27
+ Once you have created the Space, you'll see the `Building` status, and once it becomes `Running,` your Space is ready to go!
28
+
29
+ <img src="https://user-images.githubusercontent.com/23078323/231592155-869148a0-9a92-475f-8ebe-34d4deb2abc2.png" alt="Creating an Aim Space" width=800 />
30
+
31
+ Now, when you navigate to your Space's **App** section, you can access the Aim UI.
32
+
33
+ ## Compare your experiments with Aim on Spaces
34
+
35
+ Let's use a quick example of a PyTorch CNN trained on MNIST to demonstrate end-to-end Aim on Spaces deployment.
36
+ The full example is in the [Aim repo examples folder](https://github.com/aimhubio/aim/blob/main/examples/pytorch_track.py).
37
+
38
+ ```python
39
+ from aim import Run
40
+ from aim.pytorch import track_gradients_dists, track_params_dists
41
+
42
+ # Initialize a new Run
43
+ aim_run = Run()
44
+ ...
45
+ items = {'accuracy': acc, 'loss': loss}
46
+ aim_run.track(items, epoch=epoch, context={'subset': 'train'})
47
+
48
+ # Track weights and gradients distributions
49
+ track_params_dists(model, aim_run)
50
+ track_gradients_dists(model, aim_run)
51
+ ```
52
+
53
+ The experiments tracked by Aim are stored in the `.aim` folder. **To display the logs with the Aim UI in your Space, you need to compress the `.aim` folder to a `tar.gz` file and upload it to your Space using `git` or the Files and Versions sections of your Space.**
54
+
55
+ Here's a bash command for that:
56
+
57
+ ```bash
58
+ tar -czvf aim_repo.tar.gz .aim
59
+ ```
60
+
61
+ That’s it! Now open the App section of your Space and the Aim UI is available with your logs.
62
+ Here is what to expect:
63
+
64
+ ![Aim UI on HF Hub Spaces](https://user-images.githubusercontent.com/23078323/232034340-0ba3ebbf-0374-4b14-ba80-1d36162fc994.png)
65
+
66
+ Filter your runs using Aim’s Pythonic search. You can write pythonic [queries against](https://aimstack.readthedocs.io/en/latest/using/search.html) EVERYTHING you have tracked - metrics, hyperparams etc. Check out some [examples](https://huggingface.co/aimstack) on HF Hub Spaces.
67
+
68
+ <Tip>
69
+ Note that if your logs are in TensorBoard format, you can easily convert <a href="https://aimstack.readthedocs.io/en/latest/quick_start/convert_data.html#show-tensorboard-logs-in-aim">them to Aim with one command</a> and use the many advanced and high-performant training run comparison features available.
70
+ </Tip>
71
+
72
+ ## More on HF Spaces
73
+
74
+ - [HF Docker spaces](https://github.com/huggingface/hub-docs/blob/main/docs/hub/spaces-sdks-docker.md)
75
+ - [HF Docker space examples](https://github.com/huggingface/hub-docs/blob/main/docs/hub/spaces-sdks-docker.md)
76
+
77
+ ## Feedback and Support
78
+
79
+ If you have improvement suggestions or need support, please open an issue on [Aim GitHub repo](https://github.com/aimhubio/aim).
80
+
81
+ The [Aim community Discord](https://github.com/aimhubio/aim#-community) is also available for community discussions.
aim_repo.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad85d625c781762b8f127a84d456a8d2f8ae602b37a8ef1dbe4b5dd64c9cff54
3
+ size 1369