-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
88 lines (81 loc) · 2.51 KB
/
setup.py
File metadata and controls
88 lines (81 loc) · 2.51 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
import setuptools
import io,re
import subprocess
project_name = "jllm"
version = "5.0.5"
def get_version(version):
try:
tag = subprocess.check_output(
['git', 'describe', '--exact-match', '--tags', 'HEAD'],
stderr=subprocess.DEVNULL
).decode().strip()
if re.match(r'^v?(\d+\.\d+\.\d+)$', tag):
version = tag.lstrip('v')
else:
commit = _get_commit_short()
version = f"{version}+{commit}"
except subprocess.CalledProcessError:
commit = _get_commit_short()
version = f"{version}+{commit}"
except Exception:
version = version
is_dirty = _is_git_working_directory_dirty()
if is_dirty:
version += ".edited"
return version
def _get_commit_short():
try:
commit = subprocess.check_output(
['git', 'rev-parse', '--short', 'HEAD'],
stderr=subprocess.DEVNULL
).decode().strip()
return commit
except Exception:
return 'unknown'
def _is_git_working_directory_dirty():
try:
subprocess.check_call(
['git', 'diff', '--quiet'],
stderr=subprocess.DEVNULL
)
subprocess.check_call(
['git', 'diff', '--cached', '--quiet'],
stderr=subprocess.DEVNULL
)
return False
except subprocess.CalledProcessError:
return True
except Exception:
return False
version = get_version(version)
setuptools.setup(
name=project_name,
version=version,
author="Jian Lu",
license="Apache 2.0",
description=("Running Large Language Model easily, faster and low-cost."),
url="https://github.com/janelu9/EasyLLM",
project_urls={
"Homepage": "https://github.com/janelu9/EasyLLM",
},
long_description=io.open("README.md", "r", encoding="utf-8").read(),
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: Apache Software License",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
packages=setuptools.find_packages(),
include_package_data=True,
python_requires='>=3.9',
install_requires=[
"deepspeed",
"protobuf",
"sentencepiece",
"transformers",
"pyarrow",
"tiktoken"
],
)