Skip to content

Commit c95f1d7

Browse files
authored
Merge pull request #2 from lof310/library-documentation-update-e8617
Update from task bf424451-b0dd-4673-9379-10b865be8617
2 parents 78a6cf6 + c78df6a commit c95f1d7

14 files changed

Lines changed: 201 additions & 110 deletions

.gitignore

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,23 @@
1-
```
1+
```gitignore
22
# Python
33
__pycache__/
44
*.pyc
55
*.pyo
66
*.pyd
7-
.Python
8-
env/
9-
venv/
10-
.venv/
11-
.ENV
12-
.venv.bak
13-
pip-log.txt
14-
pip-delete-this-directory.txt
15-
.tox/
16-
.coverage
17-
.coverage.*
18-
.cache
19-
nosetests.xml
20-
coverage.xml
21-
*.cover
22-
*.log
23-
.git/modules
24-
.DS_Store
25-
Thumbs.db
26-
27-
# Distribution / packaging
28-
.Python
29-
build/
30-
develop-eggs/
31-
dist/
32-
downloads/
33-
eggs/
34-
.eggs/
35-
lib/
36-
lib64/
37-
parts/
38-
sdist/
39-
var/
40-
wheels/
417
*.egg-info/
42-
.installed.cfg
43-
*.egg
44-
45-
# Pytest
46-
.pytest_cache/
47-
48-
# IDE
49-
.vscode/
50-
.idea/
518

52-
# Environment
9+
# Dependencies
10+
.venv/
11+
venv/
5312
.env
5413
.env.local
55-
*.env.*
14+
.env.*
5615

57-
# OS
58-
.DS_Store
59-
Thumbs.db
16+
# Logs and temp files
17+
*.log
18+
*.tmp
19+
20+
# Editors
21+
.vscode/
22+
.idea/
6023
```

docs/source/api.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,24 @@ This section provides detailed documentation of all public modules and classes.
5151
:show-inheritance:
5252
```
5353

54+
### PartialRoPE
55+
56+
```{eval-rst}
57+
.. autoclass:: transformer.pos.PartialRoPE
58+
:members:
59+
:undoc-members:
60+
:show-inheritance:
61+
```
62+
63+
### ALiBi (Attention with Linear Biases)
64+
65+
```{eval-rst}
66+
.. autoclass:: transformer.pos.ALiBi
67+
:members:
68+
:undoc-members:
69+
:show-inheritance:
70+
```
71+
5472
## Feed-Forward Modules
5573

5674
### SwiGLU
@@ -91,3 +109,12 @@ This section provides detailed documentation of all public modules and classes.
91109
:show-inheritance:
92110
:special-members: __init__
93111
```
112+
113+
## Utilities
114+
115+
```{eval-rst}
116+
.. automodule:: transformer.utils
117+
:members:
118+
:undoc-members:
119+
:show-inheritance:
120+
```

transformer.egg-info/PKG-INFO

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ from transformer import Transformer, TransformerConfig
7575
# Configure the model
7676
config = TransformerConfig(
7777
n_layers = 12,
78-
n_heads: int = 32,
79-
d_model: int = 1536,
80-
attn_qk_norm: bool = False,
81-
tied_weights: bool = False,
82-
seq_len: int = 1024,
83-
max_seq_len: int = 4096,
78+
n_heads = 32,
79+
d_model = 1536,
80+
attn_qk_norm = False,
81+
tied_weights = False,
82+
seq_len = 1024,
83+
max_seq_len = 4096,
8484
)
8585

8686
# Initialize model

transformer/__init__.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
from .attns import GQA, MHA, CrossAttention
22
from .config import TransformerConfig
33
from .ffn import MLP, SwiGLU
4-
from .pos import RoPE
4+
from .pos import RoPE, PartialRoPE, ALiBi
55
from .transformer import Transformer, TransformerBlock
6+
from .utils import check_type, resolve_layer_config
67

7-
__all__ = ["TransformerConfig", "GQA", "MHA", "CrossAttention", "RoPE", "SwiGLU", "MLP", "TransformerBlock", "Transformer"]
8+
__all__ = [
9+
"TransformerConfig",
10+
"GQA",
11+
"MHA",
12+
"CrossAttention",
13+
"RoPE",
14+
"PartialRoPE",
15+
"ALiBi",
16+
"SwiGLU",
17+
"MLP",
18+
"TransformerBlock",
19+
"Transformer",
20+
"check_type",
21+
"resolve_layer_config"
22+
]
823

9-
__version__ = "0.4.0"
24+
__version__ = "0.5.0"
650 Bytes
Binary file not shown.
27.9 KB
Binary file not shown.
7.69 KB
Binary file not shown.
4.63 KB
Binary file not shown.
15.9 KB
Binary file not shown.
21.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)