Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CITATION.cff and fix F401 warning #183

Merged
merged 9 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
)

kashif marked this conversation as resolved.
Show resolved Hide resolved

__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
Loading