mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-19 22:02:06 +00:00
Nix: the launcher needs a Python env with Torch for GPU detection (#3085)
This makes `nix run .` in the repository work again. Should fix #3025.
This commit is contained in:
parent
622908deab
commit
976eae216f
21
flake.nix
21
flake.nix
@ -44,9 +44,24 @@
|
||||
benchmark = cargoNix.workspaceMembers.text-generation-benchmark.build.override {
|
||||
inherit crateOverrides;
|
||||
};
|
||||
launcher = cargoNix.workspaceMembers.text-generation-launcher.build.override {
|
||||
inherit crateOverrides;
|
||||
};
|
||||
launcher =
|
||||
let
|
||||
launcherUnwrapped = cargoNix.workspaceMembers.text-generation-launcher.build.override {
|
||||
inherit crateOverrides;
|
||||
};
|
||||
packagePath =
|
||||
with pkgs.python3.pkgs;
|
||||
makePythonPath [
|
||||
torch
|
||||
];
|
||||
in
|
||||
pkgs.writeShellApplication {
|
||||
name = "text-generation-launcher";
|
||||
text = ''
|
||||
PYTHONPATH="${packagePath}" ${launcherUnwrapped}/bin/text-generation-launcher "$@"
|
||||
'';
|
||||
};
|
||||
|
||||
router =
|
||||
let
|
||||
routerUnwrapped = cargoNix.workspaceMembers.text-generation-router-v3.build.override {
|
||||
|
Loading…
Reference in New Issue
Block a user