Spaces:
Running
Running
tamohannes
commited on
Commit
•
65495ee
1
Parent(s):
9e0c148
[feat] Update instruction
Browse files
README.md
CHANGED
@@ -8,31 +8,73 @@ license: other
|
|
8 |
fullWidth: true
|
9 |
---
|
10 |
|
11 |
-
|
12 |
|
13 |
-
|
|
|
14 |
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
- Duplicating the space. Simply click on the three-dot icon and select `Duplicate this Space` from the drop-down menu that appears on the right.
|
18 |
-
- Alternatively, you can create a new space using the Aim space, select the `Docker` option under `Select the Space SDK`, and choose `AimStack`.
|
19 |
<img src="https://user-images.githubusercontent.com/23078323/231592155-869148a0-9a92-475f-8ebe-34d4deb2abc2.png" alt="Creating an Aim Space" width=800 />
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
25 |
|
|
|
|
|
|
|
26 |
```
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
```
|
29 |
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
|
|
|
|
32 |
|
33 |
-
|
34 |
-
Aim is an open-source, self-hosted AI Metadata tracking tool designed to handle 100,000s of tracked metadata sequences. Two most famous AI metadata applications are: experiment tracking and prompt engineering.
|
35 |
|
36 |
-
|
37 |
|
38 |
-
|
|
|
8 |
fullWidth: true
|
9 |
---
|
10 |
|
11 |
+
# Aim on Spaces
|
12 |
|
13 |
+
**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.
|
14 |
+
Hugging Face Spaces make it easy for you to create and deploy ML-powered demos in minutes.
|
15 |
|
16 |
+
Check out the [Hugging Face Spaces docs](https://huggingface.co/docs/hub/spaces-overview) to learn more about Spaces.
|
17 |
+
|
18 |
+
## Deploy Aim on Spaces
|
19 |
+
|
20 |
+
You can deploy Aim on Spaces with a single click!
|
21 |
+
|
22 |
+
<a href="https://huggingface.co/new-space?template=aimstack/aim">
|
23 |
+
<img src="https://huggingface.co/datasets/huggingface/badges/raw/main/deploy-to-spaces-lg.svg" />
|
24 |
+
</a>
|
25 |
+
|
26 |
+
Once you have created the Space, you'll see the `Building` status, and once it becomes `Running,` your Space is ready to go!
|
27 |
|
|
|
|
|
28 |
<img src="https://user-images.githubusercontent.com/23078323/231592155-869148a0-9a92-475f-8ebe-34d4deb2abc2.png" alt="Creating an Aim Space" width=800 />
|
29 |
|
30 |
+
Now, when you navigate to your Space's **App** section, you can access the Aim UI.
|
31 |
+
|
32 |
+
## Compare your experiments with Aim on Spaces
|
33 |
+
|
34 |
+
Let's use a quick example of a PyTorch CNN trained on MNIST to demonstrate end-to-end Aim on Spaces deployment.
|
35 |
+
The full example is in the [Aim repo examples folder](https://github.com/aimhubio/aim/blob/main/examples/pytorch_track.py).
|
36 |
+
|
37 |
+
```python
|
38 |
+
from aim import Run
|
39 |
+
from aim.pytorch import track_gradients_dists, track_params_dists
|
40 |
|
41 |
+
# Initialize a new Run
|
42 |
+
aim_run = Run()
|
43 |
+
...
|
44 |
+
items = {'accuracy': acc, 'loss': loss}
|
45 |
+
aim_run.track(items, epoch=epoch, context={'subset': 'train'})
|
46 |
|
47 |
+
# Track weights and gradients distributions
|
48 |
+
track_params_dists(model, aim_run)
|
49 |
+
track_gradients_dists(model, aim_run)
|
50 |
```
|
51 |
+
|
52 |
+
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.**
|
53 |
+
|
54 |
+
Here's a bash command for that:
|
55 |
+
|
56 |
+
```bash
|
57 |
+
tar -czvf aim_repo.tar.gz .aim
|
58 |
```
|
59 |
|
60 |
+
That’s it! Now open the App section of your Space and the Aim UI is available with your logs.
|
61 |
+
Here is what to expect:
|
62 |
+
|
63 |
+
![Aim UI on HF Hub Spaces](https://user-images.githubusercontent.com/23078323/232034340-0ba3ebbf-0374-4b14-ba80-1d36162fc994.png)
|
64 |
+
|
65 |
+
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.
|
66 |
+
|
67 |
+
<Tip>
|
68 |
+
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.
|
69 |
+
</Tip>
|
70 |
+
|
71 |
+
## More on HF Spaces
|
72 |
|
73 |
+
- [HF Docker spaces](https://github.com/huggingface/hub-docs/blob/main/docs/hub/spaces-sdks-docker.md)
|
74 |
+
- [HF Docker space examples](https://github.com/huggingface/hub-docs/blob/main/docs/hub/spaces-sdks-docker.md)
|
75 |
|
76 |
+
## Feedback and Support
|
|
|
77 |
|
78 |
+
If you have improvement suggestions or need support, please open an issue on [Aim GitHub repo](https://github.com/aimhubio/aim).
|
79 |
|
80 |
+
The [Aim community Discord](https://github.com/aimhubio/aim#-community) is also available for community discussions.
|