mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-06-08 10:22:05 +00:00
Nix: switch to hf-nix (#3240)
* Nix: switch to hf-nix * Remove outdated local overrides
This commit is contained in:
parent
f08b44ade5
commit
f58d7cf50e
2
.github/workflows/nix_build.yaml
vendored
2
.github/workflows/nix_build.yaml
vendored
@ -21,7 +21,7 @@ jobs:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- uses: cachix/cachix-action@v14
|
||||
with:
|
||||
name: text-generation-inference
|
||||
name: huggingface
|
||||
# If you chose signing key for write access
|
||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||
env:
|
||||
|
2
.github/workflows/nix_cache.yaml
vendored
2
.github/workflows/nix_cache.yaml
vendored
@ -20,7 +20,7 @@ jobs:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- uses: cachix/cachix-action@v14
|
||||
with:
|
||||
name: text-generation-inference
|
||||
name: huggingface
|
||||
# If you chose signing key for write access
|
||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
env:
|
||||
|
2
.github/workflows/nix_tests.yaml
vendored
2
.github/workflows/nix_tests.yaml
vendored
@ -25,7 +25,7 @@ jobs:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- uses: cachix/cachix-action@v14
|
||||
with:
|
||||
name: text-generation-inference
|
||||
name: huggingface
|
||||
# If you chose signing key for write access
|
||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||
env:
|
||||
|
@ -6,7 +6,7 @@
|
||||
FROM nixos/nix:2.18.8 AS builder
|
||||
RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
||||
RUN nix profile install nixpkgs#cachix
|
||||
RUN cachix use text-generation-inference
|
||||
RUN cachix use huggingface
|
||||
WORKDIR /root
|
||||
ADD . .
|
||||
RUN nix build .
|
||||
|
@ -256,7 +256,7 @@ Another option is to install `text-generation-inference` locally using [Nix](htt
|
||||
we only support Nix on x86_64 Linux with CUDA GPUs. When using Nix, all dependencies can
|
||||
be pulled from a binary cache, removing the need to build them locally.
|
||||
|
||||
First follow the instructions to [install Cachix and enable the TGI cache](https://app.cachix.org/cache/text-generation-inference).
|
||||
First follow the instructions to [install Cachix and enable the Hugging Face cache](https://app.cachix.org/cache/huggingface).
|
||||
Setting up the cache is important, otherwise Nix will build many of the dependencies
|
||||
locally, which can take hours.
|
||||
|
||||
|
59
flake.lock
59
flake.lock
@ -102,7 +102,7 @@
|
||||
"flake-parts": "flake-parts_3",
|
||||
"nix-test-runner": "nix-test-runner_3",
|
||||
"nixpkgs": [
|
||||
"tgi-nix",
|
||||
"hf-nix",
|
||||
"nixpkgs"
|
||||
],
|
||||
"pre-commit-hooks": "pre-commit-hooks_3"
|
||||
@ -579,6 +579,26 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hf-nix": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_4",
|
||||
"flake-utils": "flake-utils_7",
|
||||
"nixpkgs": "nixpkgs_6"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1747919133,
|
||||
"narHash": "sha256-VvF1naQOvv7yulQ5/cDiaxkNxlh1Y84QMZnderv1szk=",
|
||||
"owner": "huggingface",
|
||||
"repo": "hf-nix",
|
||||
"rev": "9c71e026d6c7c8588ef85a5f7c77f57d598e038c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "huggingface",
|
||||
"repo": "hf-nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-filter": {
|
||||
"locked": {
|
||||
"lastModified": 1731533336,
|
||||
@ -718,16 +738,16 @@
|
||||
},
|
||||
"nixpkgs_6": {
|
||||
"locked": {
|
||||
"lastModified": 1746711195,
|
||||
"narHash": "sha256-bSpM2ySq12PBOVN7jZdzXsc99iRoYOyolh5wz43+CjQ=",
|
||||
"lastModified": 1747820358,
|
||||
"narHash": "sha256-fTqsZsUX6M3yeEvgyQvXcbGmT2CaRVyVwsi8eK29Oj4=",
|
||||
"owner": "danieldk",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6b7a66b06ccb09ac95872ac6ddf952e0660672ab",
|
||||
"rev": "d3c1681180717528068082103bf323147de6ab0b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "danieldk",
|
||||
"ref": "kernel-builder-cuda-12.9.0",
|
||||
"ref": "cudatoolkit-12.9-kernel-builder",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
@ -836,19 +856,19 @@
|
||||
"inputs": {
|
||||
"crate2nix": "crate2nix",
|
||||
"flake-utils": "flake-utils_6",
|
||||
"hf-nix": "hf-nix",
|
||||
"nix-filter": "nix-filter",
|
||||
"nixpkgs": [
|
||||
"tgi-nix",
|
||||
"hf-nix",
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-overlay": "rust-overlay",
|
||||
"tgi-nix": "tgi-nix"
|
||||
"rust-overlay": "rust-overlay"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"tgi-nix",
|
||||
"hf-nix",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
@ -970,27 +990,6 @@
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tgi-nix": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_4",
|
||||
"flake-utils": "flake-utils_7",
|
||||
"nixpkgs": "nixpkgs_6"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1747733488,
|
||||
"narHash": "sha256-LYov4H9zvqXXlFKdytcVcDioH416c+LWfyw/HWta0qw=",
|
||||
"owner": "huggingface",
|
||||
"repo": "text-generation-inference-nix",
|
||||
"rev": "61c730990efa58e64c652bf15253aae47dd0f7dd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "huggingface",
|
||||
"ref": "merge-with-kernel-builder",
|
||||
"repo": "text-generation-inference-nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
14
flake.nix
14
flake.nix
@ -2,15 +2,15 @@
|
||||
inputs = {
|
||||
crate2nix = {
|
||||
url = "github:nix-community/crate2nix";
|
||||
inputs.nixpkgs.follows = "tgi-nix/nixpkgs";
|
||||
inputs.nixpkgs.follows = "hf-nix/nixpkgs";
|
||||
};
|
||||
nix-filter.url = "github:numtide/nix-filter";
|
||||
tgi-nix.url = "github:huggingface/text-generation-inference-nix/merge-with-kernel-builder";
|
||||
nixpkgs.follows = "tgi-nix/nixpkgs";
|
||||
hf-nix.url = "github:huggingface/hf-nix";
|
||||
nixpkgs.follows = "hf-nix/nixpkgs";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "tgi-nix/nixpkgs";
|
||||
inputs.nixpkgs.follows = "hf-nix/nixpkgs";
|
||||
};
|
||||
};
|
||||
outputs =
|
||||
@ -21,7 +21,7 @@
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
rust-overlay,
|
||||
tgi-nix,
|
||||
hf-nix,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
@ -33,10 +33,10 @@
|
||||
};
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
inherit (tgi-nix.lib) config;
|
||||
inherit (hf-nix.lib) config;
|
||||
overlays = [
|
||||
rust-overlay.overlays.default
|
||||
tgi-nix.overlays.default
|
||||
hf-nix.overlays.default
|
||||
(import nix/overlay.nix)
|
||||
];
|
||||
};
|
||||
|
@ -13,26 +13,26 @@ final: prev: {
|
||||
(
|
||||
python-self: python-super: with python-self; {
|
||||
# Python package override example:
|
||||
transformers = python-super.transformers.overrideAttrs (
|
||||
_: _: {
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "huggingface";
|
||||
repo = "transformers";
|
||||
rev = "v4.51.0";
|
||||
hash = "sha256-dnVpc6fm1SYGcx7FegpwVVxUY6XRlsxLs5WOxYv11y8=";
|
||||
};
|
||||
}
|
||||
);
|
||||
huggingface-hub = python-super.huggingface-hub.overrideAttrs (
|
||||
_: _: {
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "huggingface";
|
||||
repo = "huggingface_hub";
|
||||
rev = "v0.30.0";
|
||||
hash = "sha256-sz+n1uoWrSQPqJFiG/qCT6b4r08kD9MsoPZXbfWNB2o=";
|
||||
};
|
||||
}
|
||||
);
|
||||
#transformers = python-super.transformers.overrideAttrs (
|
||||
# _: _: {
|
||||
# src = final.fetchFromGitHub {
|
||||
# owner = "huggingface";
|
||||
# repo = "transformers";
|
||||
# rev = "v4.51.0";
|
||||
# hash = "sha256-dnVpc6fm1SYGcx7FegpwVVxUY6XRlsxLs5WOxYv11y8=";
|
||||
# };
|
||||
# }
|
||||
#);
|
||||
#huggingface-hub = python-super.huggingface-hub.overrideAttrs (
|
||||
# _: _: {
|
||||
# src = final.fetchFromGitHub {
|
||||
# owner = "huggingface";
|
||||
# repo = "huggingface_hub";
|
||||
# rev = "v0.30.0";
|
||||
# hash = "sha256-sz+n1uoWrSQPqJFiG/qCT6b4r08kD9MsoPZXbfWNB2o=";
|
||||
# };
|
||||
# }
|
||||
#);
|
||||
}
|
||||
)
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user