Skip to content

Commit 9856335

Browse files
kashifalvarobartt
andauthored
CITATION.cff and fix F401 warning (#183)
* fix F401 warning * add CITATION.cff * update version in CITATION * update title * fix label * Update src/alignment/__init__.py Co-authored-by: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com> * make style * add Alvaro Bartolome * update version in readme --------- Co-authored-by: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com>
1 parent 95dc472 commit 9856335

File tree

4 files changed

+77
-12
lines changed

4 files changed

+77
-12
lines changed

CITATION.cff

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
cff-version: 1.2.0
2+
title: The Alignment Handbook
3+
message: >-
4+
Robust recipes to align language models with human and AI
5+
preferences.
6+
type: software
7+
authors:
8+
- given-names: Lewis
9+
family-names: Tunstall
10+
- given-names: Edward
11+
family-names: Beeching
12+
- given-names: Nathan
13+
family-names: Lambert
14+
- given-names: Nazneen
15+
family-names: Rajani
16+
- given-names: Shengyi
17+
family-names: Huang
18+
- given-names: Kashif
19+
family-names: Rasul
20+
- given-names: Alvaro
21+
family-names: Bartolome
22+
- given-names: Alexander
23+
name-particle: M.
24+
family-names: Rush
25+
- given-names: Thomas
26+
family-names: Wolf
27+
repository-code: 'https://github.com/huggingface/alignment-handbook'
28+
license: Apache-2.0
29+
version: 0.3.0.dev0

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,14 @@ You can now check out the `scripts` and `recipes` directories for instructions o
115115

116116
## Citation
117117

118-
If you find the content of this repo useful in your work, please cite it as follows:
118+
If you find the content of this repo useful in your work, please cite it as follows via '\usepackage{biblatex}`:
119119

120120
```bibtex
121-
@misc{alignment_handbook2023,
122-
author = {Lewis Tunstall and Edward Beeching and Nathan Lambert and Nazneen Rajani and Shengyi Huang and Kashif Rasul and Alexander M. Rush and Thomas Wolf},
123-
title = {The Alignment Handbook},
124-
year = {2023},
125-
publisher = {GitHub},
126-
journal = {GitHub repository},
127-
howpublished = {\url{https://github.com/huggingface/alignment-handbook}}
121+
@software{Tunstall_The_Alignment_Handbook,
122+
author = {Tunstall, Lewis and Beeching, Edward and Lambert, Nathan and Rajani, Nazneen and Huang, Shengyi and Rasul, Kashif and Bartolome, Alvaro and M. Rush, Alexander and Wolf, Thomas},
123+
license = {Apache-2.0},
124+
title = {{The Alignment Handbook}},
125+
url = {https://github.com/huggingface/alignment-handbook},
126+
version = {0.3.0.dev0}
128127
}
129128
```

src/alignment/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,21 @@
1111
get_tokenizer,
1212
is_adapter_model,
1313
)
14+
15+
16+
__all__ = [
17+
"DataArguments",
18+
"DPOConfig",
19+
"H4ArgumentParser",
20+
"ModelArguments",
21+
"SFTConfig",
22+
"apply_chat_template",
23+
"get_datasets",
24+
"decontaminate_humaneval",
25+
"get_checkpoint",
26+
"get_kbit_device_map",
27+
"get_peft_config",
28+
"get_quantization_config",
29+
"get_tokenizer",
30+
"is_adapter_model",
31+
]

src/alignment/release.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,29 @@
2020

2121

2222
REPLACE_PATTERNS = {
23-
"init": (re.compile(r'^__version__\s+=\s+"([^"]+)"\s*$', re.MULTILINE), '__version__ = "VERSION"\n'),
24-
"setup": (re.compile(r'^(\s*)version\s*=\s*"[^"]+",', re.MULTILINE), r'\1version="VERSION",'),
23+
"init": (
24+
re.compile(r'^__version__\s+=\s+"([^"]+)"\s*$', re.MULTILINE),
25+
'__version__ = "VERSION"\n',
26+
),
27+
"setup": (
28+
re.compile(r'^(\s*)version\s*=\s*"[^"]+",', re.MULTILINE),
29+
r'\1version="VERSION",',
30+
),
31+
"citation": (re.compile(r"^version:\s+[^ ]+", re.MULTILINE), "version: VERSION"),
32+
"readme": (
33+
re.compile(r"version\s+=\s+\{[^}]+\}", re.MULTILINE),
34+
"version = {VERSION}",
35+
),
2536
}
37+
38+
README_FILE = "README.md"
39+
2640
REPLACE_FILES = {
2741
"init": "src/alignment/__init__.py",
2842
"setup": "setup.py",
43+
"citation": "CITATION.cff",
44+
"readme": README_FILE,
2945
}
30-
README_FILE = "README.md"
3146

3247

3348
def update_version_in_file(fname, version, pattern):
@@ -95,7 +110,11 @@ def post_release_work():
95110

96111
if __name__ == "__main__":
97112
parser = argparse.ArgumentParser()
98-
parser.add_argument("--post_release", action="store_true", help="Whether this is pre or post release.")
113+
parser.add_argument(
114+
"--post_release",
115+
action="store_true",
116+
help="Whether this is pre or post release.",
117+
)
99118
parser.add_argument("--patch", action="store_true", help="Whether or not this is a patch release.")
100119
args = parser.parse_args()
101120
if not args.post_release:

0 commit comments

Comments
 (0)