tamohannes commited on
Commit
65495ee
1 Parent(s): 9e0c148

[feat] Update instruction

Browse files
Files changed (1) hide show
  1. README.md +56 -14
README.md CHANGED
@@ -8,31 +8,73 @@ license: other
8
  fullWidth: true
9
  ---
10
 
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
12
 
13
- # How to setup your own Aim space?
 
14
 
15
- Setting up an Aim space is incredibly easy. There are two primary methods to do so:
 
 
 
 
 
 
 
 
 
 
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
- Both options will generate an empty Aim space along with a newly initialized repository.
 
 
 
 
 
 
 
 
 
22
 
23
- After successfully creating an Aim space, you can push your logs to be displayed. 🚀
24
- To do so, we need to replace the initial `aim_repo.tar.gz` file with your own Aim repo by running the following command:
 
 
 
25
 
 
 
 
26
  ```
27
- tar -czvf aim_repo.tar.gz /PATH/TO/MY/AIM/REPO
 
 
 
 
 
 
28
  ```
29
 
30
- And that's it! The space will be automatically updated, and you can start enjoying Aim's supercharged and beautiful UI. 😊
 
 
 
 
 
 
 
 
 
 
 
31
 
 
 
32
 
33
- # Learn more about Aim
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
- Aim provides a performant and beautiful UI for exploring and comparing training runs, prompt sessions. Additionally, its SDK enables programmatic access to tracked metadata — perfect for automations and Jupyter Notebook analysis.
37
 
38
- For more information about Aim, please visit the [GitHub page](https://github.com/aimhubio/aim) and [documentation](https://aimstack.readthedocs.io/en/latest/index.html). You can also explore HuggingFace Spaces provided by [Aim](https://huggingface.co/aimstack).
 
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.