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 3 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
27 changes: 27 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cff-version: 1.2.0
title: 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: 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
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",
]
26 changes: 21 additions & 5 deletions src/alignment/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@


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"),
}
REPLACE_FILES = {
"init": "src/alignment/__init__.py",
"setup": "setup.py",
"citation": "CITATION.cff",
}
README_FILE = "README.md"

Expand Down Expand Up @@ -60,7 +68,9 @@ def pre_release_work(patch=False):
# First let's get the default version: base version if we are in dev, bump minor otherwise.
default_version = get_version()
if patch and default_version.is_devrelease:
raise ValueError("Can't create a patch version from the dev branch, checkout a released version!")
raise ValueError(
"Can't create a patch version from the dev branch, checkout a released version!"
)
if default_version.is_devrelease:
default_version = default_version.base_version
elif patch:
Expand Down Expand Up @@ -95,8 +105,14 @@ 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("--patch", action="store_true", help="Whether or not this is a patch 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:
pre_release_work(patch=args.patch)
Expand Down
Loading