Skip to content

Commit

Permalink
CITATION.cff and fix F401 warning (#183)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
kashif and alvarobartt authored Jul 30, 2024
1 parent 95dc472 commit 9856335
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 12 deletions.
29 changes: 29 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cff-version: 1.2.0
title: The Alignment Handbook
message: >-
Robust recipes to align language models with human and AI
preferences.
type: software
authors:
- given-names: Lewis
family-names: Tunstall
- given-names: Edward
family-names: Beeching
- given-names: Nathan
family-names: Lambert
- given-names: Nazneen
family-names: Rajani
- given-names: Shengyi
family-names: Huang
- given-names: Kashif
family-names: Rasul
- given-names: Alvaro
family-names: Bartolome
- given-names: Alexander
name-particle: M.
family-names: Rush
- given-names: Thomas
family-names: Wolf
repository-code: 'https://github.com/huggingface/alignment-handbook'
license: Apache-2.0
version: 0.3.0.dev0
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,14 @@ You can now check out the `scripts` and `recipes` directories for instructions o

## Citation

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

```bibtex
@misc{alignment_handbook2023,
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},
title = {The Alignment Handbook},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/huggingface/alignment-handbook}}
@software{Tunstall_The_Alignment_Handbook,
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},
license = {Apache-2.0},
title = {{The Alignment Handbook}},
url = {https://github.com/huggingface/alignment-handbook},
version = {0.3.0.dev0}
}
```
18 changes: 18 additions & 0 deletions src/alignment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,21 @@
get_tokenizer,
is_adapter_model,
)


__all__ = [
"DataArguments",
"DPOConfig",
"H4ArgumentParser",
"ModelArguments",
"SFTConfig",
"apply_chat_template",
"get_datasets",
"decontaminate_humaneval",
"get_checkpoint",
"get_kbit_device_map",
"get_peft_config",
"get_quantization_config",
"get_tokenizer",
"is_adapter_model",
]
27 changes: 23 additions & 4 deletions src/alignment/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,29 @@


REPLACE_PATTERNS = {
"init": (re.compile(r'^__version__\s+=\s+"([^"]+)"\s*$', re.MULTILINE), '__version__ = "VERSION"\n'),
"setup": (re.compile(r'^(\s*)version\s*=\s*"[^"]+",', re.MULTILINE), r'\1version="VERSION",'),
"init": (
re.compile(r'^__version__\s+=\s+"([^"]+)"\s*$', re.MULTILINE),
'__version__ = "VERSION"\n',
),
"setup": (
re.compile(r'^(\s*)version\s*=\s*"[^"]+",', re.MULTILINE),
r'\1version="VERSION",',
),
"citation": (re.compile(r"^version:\s+[^ ]+", re.MULTILINE), "version: VERSION"),
"readme": (
re.compile(r"version\s+=\s+\{[^}]+\}", re.MULTILINE),
"version = {VERSION}",
),
}

README_FILE = "README.md"

REPLACE_FILES = {
"init": "src/alignment/__init__.py",
"setup": "setup.py",
"citation": "CITATION.cff",
"readme": README_FILE,
}
README_FILE = "README.md"


def update_version_in_file(fname, version, pattern):
Expand Down Expand Up @@ -95,7 +110,11 @@ def post_release_work():

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--post_release", action="store_true", help="Whether this is pre or post release.")
parser.add_argument(
"--post_release",
action="store_true",
help="Whether this is pre or post release.",
)
parser.add_argument("--patch", action="store_true", help="Whether or not this is a patch release.")
args = parser.parse_args()
if not args.post_release:
Expand Down

0 comments on commit 9856335

Please sign in to comment.