Skip to content

Commit f58d7cf

Browse files
authored
Nix: switch to hf-nix (#3240)
* Nix: switch to hf-nix * Remove outdated local overrides
1 parent f08b44a commit f58d7cf

File tree

8 files changed

+61
-62
lines changed

8 files changed

+61
-62
lines changed

.github/workflows/nix_build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
nix_path: nixpkgs=channel:nixos-unstable
2222
- uses: cachix/cachix-action@v14
2323
with:
24-
name: text-generation-inference
24+
name: huggingface
2525
# If you chose signing key for write access
2626
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
2727
env:

.github/workflows/nix_cache.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
nix_path: nixpkgs=channel:nixos-unstable
2121
- uses: cachix/cachix-action@v14
2222
with:
23-
name: text-generation-inference
23+
name: huggingface
2424
# If you chose signing key for write access
2525
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
2626
env:

.github/workflows/nix_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
nix_path: nixpkgs=channel:nixos-unstable
2626
- uses: cachix/cachix-action@v14
2727
with:
28-
name: text-generation-inference
28+
name: huggingface
2929
# If you chose signing key for write access
3030
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
3131
env:

Dockerfile.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
FROM nixos/nix:2.18.8 AS builder
77
RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
88
RUN nix profile install nixpkgs#cachix
9-
RUN cachix use text-generation-inference
9+
RUN cachix use huggingface
1010
WORKDIR /root
1111
ADD . .
1212
RUN nix build .

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Another option is to install `text-generation-inference` locally using [Nix](htt
256256
we only support Nix on x86_64 Linux with CUDA GPUs. When using Nix, all dependencies can
257257
be pulled from a binary cache, removing the need to build them locally.
258258

259-
First follow the instructions to [install Cachix and enable the TGI cache](https://app.cachix.org/cache/text-generation-inference).
259+
First follow the instructions to [install Cachix and enable the Hugging Face cache](https://app.cachix.org/cache/huggingface).
260260
Setting up the cache is important, otherwise Nix will build many of the dependencies
261261
locally, which can take hours.
262262

flake.lock

Lines changed: 29 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
inputs = {
33
crate2nix = {
44
url = "github:nix-community/crate2nix";
5-
inputs.nixpkgs.follows = "tgi-nix/nixpkgs";
5+
inputs.nixpkgs.follows = "hf-nix/nixpkgs";
66
};
77
nix-filter.url = "github:numtide/nix-filter";
8-
tgi-nix.url = "github:huggingface/text-generation-inference-nix/merge-with-kernel-builder";
9-
nixpkgs.follows = "tgi-nix/nixpkgs";
8+
hf-nix.url = "github:huggingface/hf-nix";
9+
nixpkgs.follows = "hf-nix/nixpkgs";
1010
flake-utils.url = "github:numtide/flake-utils";
1111
rust-overlay = {
1212
url = "github:oxalica/rust-overlay";
13-
inputs.nixpkgs.follows = "tgi-nix/nixpkgs";
13+
inputs.nixpkgs.follows = "hf-nix/nixpkgs";
1414
};
1515
};
1616
outputs =
@@ -21,7 +21,7 @@
2121
nixpkgs,
2222
flake-utils,
2323
rust-overlay,
24-
tgi-nix,
24+
hf-nix,
2525
}:
2626
flake-utils.lib.eachDefaultSystem (
2727
system:
@@ -33,10 +33,10 @@
3333
};
3434
pkgs = import nixpkgs {
3535
inherit system;
36-
inherit (tgi-nix.lib) config;
36+
inherit (hf-nix.lib) config;
3737
overlays = [
3838
rust-overlay.overlays.default
39-
tgi-nix.overlays.default
39+
hf-nix.overlays.default
4040
(import nix/overlay.nix)
4141
];
4242
};

nix/overlay.nix

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ final: prev: {
1313
(
1414
python-self: python-super: with python-self; {
1515
# Python package override example:
16-
transformers = python-super.transformers.overrideAttrs (
17-
_: _: {
18-
src = final.fetchFromGitHub {
19-
owner = "huggingface";
20-
repo = "transformers";
21-
rev = "v4.51.0";
22-
hash = "sha256-dnVpc6fm1SYGcx7FegpwVVxUY6XRlsxLs5WOxYv11y8=";
23-
};
24-
}
25-
);
26-
huggingface-hub = python-super.huggingface-hub.overrideAttrs (
27-
_: _: {
28-
src = final.fetchFromGitHub {
29-
owner = "huggingface";
30-
repo = "huggingface_hub";
31-
rev = "v0.30.0";
32-
hash = "sha256-sz+n1uoWrSQPqJFiG/qCT6b4r08kD9MsoPZXbfWNB2o=";
33-
};
34-
}
35-
);
16+
#transformers = python-super.transformers.overrideAttrs (
17+
# _: _: {
18+
# src = final.fetchFromGitHub {
19+
# owner = "huggingface";
20+
# repo = "transformers";
21+
# rev = "v4.51.0";
22+
# hash = "sha256-dnVpc6fm1SYGcx7FegpwVVxUY6XRlsxLs5WOxYv11y8=";
23+
# };
24+
# }
25+
#);
26+
#huggingface-hub = python-super.huggingface-hub.overrideAttrs (
27+
# _: _: {
28+
# src = final.fetchFromGitHub {
29+
# owner = "huggingface";
30+
# repo = "huggingface_hub";
31+
# rev = "v0.30.0";
32+
# hash = "sha256-sz+n1uoWrSQPqJFiG/qCT6b4r08kD9MsoPZXbfWNB2o=";
33+
# };
34+
# }
35+
#);
3636
}
3737
)
3838
];

0 commit comments

Comments
 (0)