-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
125 lines (112 loc) · 4.65 KB
/
pyproject.toml
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
117
118
119
120
121
122
123
124
125
[tool.poetry]
name = "llama-cpp-cffi"
version = "0.3.0"
description = "Python binding for llama.cpp using cffi"
homepage = "https://github.com/tangledgroup/llama-cpp-cffi"
repository = "https://github.com/tangledgroup/llama-cpp-cffi"
authors = ["Marko Tasic <mtasic85@gmail.com>", "Tangled Group, Inc <info@tangledgroup.com>"]
license = "MIT"
readme = "README.md"
packages = [{include = "llama"}]
include = [{path = "llama/*.so"}]
[tool.poetry.dependencies]
python = "^3.10"
attrs = "^24.2.0"
huggingface-hub = "^0.26.2"
psutil = "^6.1.0"
transformers = "^4.46.1"
jinja2 = "^3.1.4"
sentencepiece = "^0.2.0"
protobuf = "^5.28.3"
numba = "^0.60.0"
vulkan = "^1.3.275.1"
uvloop = {version = "^0.21.0", optional = true}
aiohttp = {extras = ["speedups"], version = "^3.10.10", optional = true}
gunicorn = {version = "23.0.0", optional = true}
openai = {version = "^1.53.0", optional = true}
[tool.poetry.extras]
server = ["uvloop", "aiohttp", "gunicorn", "openai"]
[tool.poetry.group.dev.dependencies]
cffi = "^1.17.1"
setuptools = "^75.3.0"
pyright = "^1.1.391 "
ruff = "^0.8.4"
cibuildwheel = "^2.21.3"
mkdocs-material = "^9.5.43"
[tool.poetry.scripts]
build = "scripts.build:build"
clean = "scripts.clean:clean"
[tool.poetry.build]
script = "scripts/build.py"
[tool.cibuildwheel]
[tool.cibuildwheel.linux]
container-engine = { name = "docker", create-args = ["--cpus", "16"]}
build-frontend = "build"
before-build = """
ARCH=$(uname -m)
pip install poetry
if [[ $AUDITWHEEL_PLAT == manylinux* ]]; then
dnf update -y
dnf install -y epel-release
dnf update -y
dnf group install -y "Development Tools"
# dnf install -y unzip p7zip p7zip-plugins upx clang-tools-extra libcurl-devel
dnf install -y clang-tools-extra libcurl-devel ninja-build
git clone https://github.com/google/shaderc
cd shaderc
./utils/git-sync-deps
mkdir build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../
ninja
ninja install
cd ../..
# vulkan
if [[ "$ARCH" == "x86_64" ]]; then
# vulkan packages only on x86_64
dnf install -y vulkan-tools vulkan-headers vulkan-loader vulkan-loader-devel vulkan-validation-layers spirv-tools
dnf install -y https://pkgs.sysadmins.ws/el8/extras/x86_64/glslc-2023.1-3.el8.x86_64.rpm https://pkgs.sysadmins.ws/el8/extras/x86_64/glslang-12.0.0-1.el8.x86_64.rpm
fi
else
# apk -U add unzip 7zip upx clang-extra-tools
apk -U add clang-extra-tools curl-dev ninja-build
# vulkan
if [[ "$ARCH" == "x86_64" ]]; then
apk -U add mesa-vulkan-ati mesa-vulkan-intel mesa-vulkan-layers mesa-vulkan-swrast vulkan-headers vulkan-loader vulkan-loader-dev vulkan-tools vulkan-validation-layers vulkan-validation-layers-dev vulkan-validation-layers-static shaderc glslang glslang-dev glslang-libs glslang-static
fi
fi
"""
skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "pp37-*", "pp38-*", "pp39-*", "*i686"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp313-*", "pp37-*", "pp38-*", "pp39-*", "*i686"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "pp37-*", "pp38-*", "pp39-*", "*i686", "*manylinux*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686", "*musllinux*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp313-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686", "*musllinux*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp313-*", "pp37-*", "pp38-*", "pp39-*", "pp310-*", "*i686", "*musllinux*"]
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64:latest"
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64:latest"
manylinux-pypy_x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64:latest"
manylinux-pypy_aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64:latest"
musllinux-x86_64-image = "quay.io/pypa/musllinux_1_2_x86_64:latest"
musllinux-aarch64-image = "quay.io/pypa/musllinux_1_2_aarch64:latest"
build-verbosity=3
repair-wheel-command = ""
# repair-wheel-command = """
# for file in {wheel}; do
# tempdir=$(mktemp -d)
# unzip -d "$tempdir" "$file"
#
# # Compress shared libraries in the tempdir using UPX
# find "$tempdir" -type f \\( -name "*.so" -o -name "*.dylib" -o -name "*.dll" \\) -exec upx -9 {} \\;
#
# # Repackage with 7z
# (cd "$tempdir" && 7z a -tzip -mx=9 -mfb=258 -mpass=15 -mmt=on "{dest_dir}/$(basename $file)" .)
#
# # Clean up
# rm -rf "$tempdir"
# done
# """
[tool.cibuildwheel.pyodide]
[build-system]
requires = ["poetry-core", "cffi", "setuptools"]
build-backend = "poetry.core.masonry.api"