Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Atry committed May 3, 2023
1 parent fa63354 commit eb2a3bf
Show file tree
Hide file tree
Showing 7 changed files with 3,226 additions and 2 deletions.
6 changes: 5 additions & 1 deletion overrides/build-systems.json
Original file line number Diff line number Diff line change
Expand Up @@ -8646,7 +8646,8 @@
"setuptools"
],
"llama-cpp-python": [
"setuptools"
"setuptools",
"scikit-build"
],
"llfuse": [
"cython",
Expand Down Expand Up @@ -11118,6 +11119,9 @@
"setuptools",
"setuptools-scm"
],
"peft": [
"setuptools"
],
"pelican": [
"setuptools"
],
Expand Down
18 changes: 17 additions & 1 deletion overrides/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,18 @@ lib.composeManyExtensions [
}
);

llama-cpp-python = super.llama-cpp-python.overridePythonAttrs (
old: {
buildInputs = with pkgs; lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Accelerate
];
nativeBuildInputs = [ pkgs.cmake ] ++ (old.nativeBuildInputs or [ ]);
preBuild = ''
cd "$OLDPWD"
'';
}
);

llvmlite = super.llvmlite.overridePythonAttrs (
old:
let
Expand Down Expand Up @@ -1583,7 +1595,7 @@ lib.composeManyExtensions [
lib.warn "Unknown orjson version: '${version}'. Please update getCargoHash." lib.fakeHash
);
in
super.orjson.overridePythonAttrs (old: {
super.orjson.overridePythonAttrs (old: if old.src.isWheel or false then { } else {
cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
inherit (old) src;
name = "${old.pname}-${old.version}";
Expand Down Expand Up @@ -1815,6 +1827,10 @@ lib.composeManyExtensions [
pkgs.cmake
];

buildInputs = (old.buildInputs or [ ]) ++ [
_arrow-cpp
];

preBuild = ''
export PYARROW_PARALLEL=$NIX_BUILD_CORES
'';
Expand Down
1 change: 1 addition & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ builtins.removeAttrs
watchfiles = callTest ./watchfiles { };
sqlalchemy = callTest ./sqlalchemy { };
tzlocal = callTest ./tzlocal { };
text-generation-webui = callTest ./text-generation-webui { };

# Cross tests fail on darwin for some strange reason:
# ERROR: MarkupSafe-2.0.1-cp39-cp39-linux_aarch64.whl is not a supported wheel on this platform.
Expand Down
9 changes: 9 additions & 0 deletions tests/text-generation-webui/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ lib, poetry2nix, python310 }:

poetry2nix.mkPoetryApplication {
python = python310;
pyproject = ./pyproject.toml;
poetrylock = ./poetry.lock;
src = lib.cleanSource ./.;
preferWheels = true;
}
3,162 changes: 3,162 additions & 0 deletions tests/text-generation-webui/poetry.lock

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions tests/text-generation-webui/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[tool.poetry]
name = "text-generation-webui-build"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies]
python = "^3.10"
accelerate = "0.18.0"
colorama = "^0.4.6"
datasets = "^2.11.0"
flexgen = "0.1.7"
gradio = "3.25.0"
markdown = "^3.4.3"
numpy = "^1.24.3"
pandas = "^2.0.0"
pillow = ">=9.5.0"
pybind11 = "2.10.4"
pyyaml = "^6.0"
requests = "^2.28.2"
rwkv = "0.7.3"
safetensors = "0.3.0"
sentencepiece = "^0.1.98"
tqdm = "^4.65.0"
peft = {git = "https://github.com/huggingface/peft"}
transformers = "4.28.1"
bitsandbytes = {version = "0.38.1", markers = "platform_system != \"Windows\""}
llama-cpp-python = {version = "0.1.34"}

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Empty file.

0 comments on commit eb2a3bf

Please sign in to comment.