-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
116 lines (101 loc) · 4.22 KB
/
Copy pathsetup.py
File metadata and controls
116 lines (101 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
from typing import List
from setuptools import setup, find_packages
import os
VERSION = {} # type: ignore
with open("src/xlm/version.py", "r") as version_file:
exec(version_file.read(), VERSION)
PATH_ROOT = os.path.dirname(__file__)
def load_requirements(
path_dir: str = PATH_ROOT, comment_char: str = "#"
) -> List:
with open(os.path.join(path_dir, "requirements.txt"), "r") as file:
reqs = [ln.strip() for ln in file.readlines()]
return reqs
def load_requirements_optional(relative_filename: str) -> List[str]:
"""Extras list for setuptools (strip blanks and inline ``#`` comments)."""
path = os.path.join(PATH_ROOT, relative_filename)
with open(path, "r") as file:
lines = file.readlines()
reqs = []
for ln in lines:
s = ln.split("#")[0].strip()
if s:
reqs.append(s)
return reqs
install_requires = load_requirements()
_safe_reqs = load_requirements_optional("requirements/safe_extra.txt")
_molgen_reqs = load_requirements_optional("requirements/molgen_requirements.txt")
_llm_eval_reqs = load_requirements_optional("requirements/llm_eval.txt")
_mauve_reqs = load_requirements_optional("requirements/mauve_text.txt")
extras_require = {
"safe": _safe_reqs,
"molgen": _molgen_reqs,
"llm_eval": _llm_eval_reqs,
"mauve": _mauve_reqs,
"all": list(
dict.fromkeys(
_safe_reqs + _molgen_reqs + _llm_eval_reqs + _mauve_reqs
),
),
}
setup(
name="xlm-core",
version=VERSION["VERSION"],
author="Dhruvesh Patel, Benjamin Rozonoyer, Sai Sreenivas Chintha, Durga Prasad Maram",
packages=find_packages(
where="src",
exclude=[
"*.tests",
"*.tests.*",
"tests.*",
"tests",
],
),
description="XLM Framework",
long_description="""
XLM is a unified framework for developing and comparing small non-autoregressive language models. It uses PyTorch as the deep learning framework, PyTorch Lightning for training utilities, and Hydra for configuration management. XLM provides core components for flexible data handling and training, useful architectural implementations for non-autoregressive workflows, and support for arbitrary runtime code injection. Custom model implementations that leverage the core components of xlm can be found in the xlm-models package. The package also includes a few preconfigured synthetic planning and language-modeling datasets.
Usage:
pip install xlm-core
pip install "xlm-core[safe]" # optional: SAFE molecule preprocessing / evaluators
pip install "xlm-core[molgen]" # optional: fuller GenMol / Biomemo stack (molgen_requirements.txt)
pip install "xlm-core[llm_eval]" # optional: ANTLR build of math-verify (LLM benchmarks)
pip install "xlm-core[mauve]" # optional: MAUVE post-hoc text evaluation (mauve-text)
pip install "xlm-core[all]" # union of safe + molgen + llm_eval + mauve (used in CI)
xlm job_type=[JOB_TYPE] job_name=[JOB_NAME] experiment=[CONFIG_PATH]
The job_type argument can be one of train ,eval and generate. The experiment argument should point to the root hydra config file.
""",
install_requires=install_requires,
extras_require=extras_require,
project_urls={"Source Code": "https://github.com/dhruvdcoder/xlm-core"},
package_dir={"": "src"},
package_data={
"xlm": [
"configs/**/*.yaml",
"configs/**/*.yml",
"tasks/safe_molgen/zinc_len.pkl",
],
},
keywords=[
"AI",
"ML",
"Machine Learning",
"Deep Learning",
"Non-Autoregressive Language Models",
],
include_package_data=True,
entry_points={
"console_scripts": [
"xlm=xlm.__main__:main",
"xlm-scaffold=xlm.commands.scaffold_model:main",
"xlm-push-to-hub=xlm.commands.push_to_hub:main",
],
},
python_requires=">=3.11",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
)