Skip to content

Commit 24d590f

Browse files
authored
init documentation (#33)
1 parent 4d98e85 commit 24d590f

23 files changed

+890
-8
lines changed

.github/workflows/docs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
pages: write
14+
id-token: write
15+
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.12'
28+
29+
- name: Install dependencies
30+
run: |
31+
./scripts/setup_stable.sh
32+
33+
- name: Configure Git
34+
run: |
35+
git config --global user.name "GitHub Actions"
36+
git config --global user.email "[email protected]"
37+
38+
- name: Get version and commit
39+
id: version
40+
run: |
41+
if [[ $GITHUB_REF == refs/tags/* ]]; then
42+
VERSION=${GITHUB_REF#refs/tags/v}
43+
SOURCE_COMMIT=${GITHUB_SHA}
44+
else
45+
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
46+
SOURCE_COMMIT=${GITHUB_SHA}
47+
fi
48+
echo "version=$VERSION" >> $GITHUB_OUTPUT
49+
echo "SOURCE_COMMIT=$SOURCE_COMMIT" >> $GITHUB_ENV
50+
51+
- name: Deploy versioned docs
52+
if: startsWith(github.ref, 'refs/tags/')
53+
run: |
54+
mike deploy --push --update-aliases ${{ steps.version.outputs.version }} latest
55+
56+
- name: Deploy dev docs
57+
if: github.ref == 'refs/heads/main'
58+
run: |
59+
mike deploy --push dev

.github/workflows/tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,33 @@ jobs:
3333
run: |
3434
black --check --diff --line-length=120 .
3535
36+
docs:
37+
name: Build documentation
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 10
40+
steps:
41+
- uses: actions/checkout@v3
42+
with:
43+
fetch-depth: 0
44+
- uses: actions/setup-python@v4
45+
with:
46+
python-version: '3.12'
47+
- name: Install documentation dependencies
48+
run: |
49+
./scripts/setup_stable.sh
50+
- name: Set source commit for docs
51+
run: |
52+
echo "SOURCE_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
53+
- name: Build documentation
54+
run: |
55+
mkdocs build --strict
56+
- name: Upload docs artifact
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: documentation-site
60+
path: site/
61+
compression-level: 6
62+
3663
test:
3764
strategy:
3865
matrix:

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Agent-lightning-banner](assets/readme-banner.png)
1+
![Agent-lightning-banner](docs/assets/readme-banner.png)
22

33
# Agent Lightning⚡
44

@@ -16,7 +16,7 @@
1616
- **Selectively** optimize one or more agents in a multi-agent system. 🎯
1717
- Embraces Reinforcement Learning, Automatic Prompt Optimization and more **algorithms**. 🤗
1818

19-
![Agent-Lightning-code-diff](assets/readme-diff.png)
19+
![Agent-Lightning-code-diff](docs/assets/readme-diff.png)
2020

2121
## ⚡ Resources
2222

@@ -107,7 +107,7 @@ Currently, Agent Lightning is built around a **training server** and one or mult
107107
* **Agents** retrieve samples from the server, process them (which may involve interacting with the LLM), and send the results back. These results, or "trajectories," are lists of prompts and responses from the LLM.
108108
* The **server** then collects these trajectories and computes the losses to optimize the language models.
109109

110-
![Agent-Lightning-architecture](assets/readme-architecture.png)
110+
![Agent-Lightning-architecture](docs/assets/readme-architecture.png)
111111

112112
## ⚡ Development Instructions
113113

@@ -126,6 +126,12 @@ pre-commit install
126126
pre-commit run --all-files --show-diff-on-failure --color=always
127127
```
128128

129+
Serve documentation locally:
130+
131+
```bash
132+
mkdocs serve
133+
```
134+
129135
## ⚡ Contributing
130136

131137
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

agentlightning/verl/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .trainer import *
2+
from .daemon import *
3+
from .dataset import *

agentlightning/verl/daemon.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def get_left_padded_ids_and_attention_mask(ids: List[int], max_length: int, pad_
3131
pad_token_id: ID to use for padding.
3232
3333
Returns:
34-
padded_ids: list of length == max_length.
35-
attention_mask: list of same length: 1 for non-pad tokens, 0 for pads.
34+
padded_ids (any): list of length == max_length.
35+
attention_mask (any): list of same length: 1 for non-pad tokens, 0 for pads.
3636
"""
3737
seq_len = len(ids)
3838

@@ -60,8 +60,8 @@ def get_right_padded_ids_and_attention_mask(ids: List[int], max_length: int, pad
6060
pad_token_id: ID to use for padding.
6161
6262
Returns:
63-
padded_ids: list of length == max_length.
64-
attention_mask: list of same length: 1 for non-pad tokens, 0 for pads.
63+
padded_ids (any): list of length == max_length.
64+
attention_mask (any): list of same length: 1 for non-pad tokens, 0 for pads.
6565
"""
6666
seq_len = len(ids)
6767

docs/assets/logo-dark.png

4.34 KB
Loading

docs/assets/logo-light.png

4.49 KB
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)