mirror of
https://github.com/wassname/alignment-handbook.git
synced 2026-09-11 12:00:25 +08:00
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>
This commit is contained in:
co-authored by
Alvaro Bartolome
parent
95dc47218c
commit
98563353d7
@@ -11,3 +11,21 @@ from .model_utils import (
|
||||
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",
|
||||
]
|
||||
|
||||
@@ -20,14 +20,29 @@ import packaging.version
|
||||
|
||||
|
||||
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):
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user