File tree Expand file tree Collapse file tree 3 files changed +71
-46
lines changed Expand file tree Collapse file tree 3 files changed +71
-46
lines changed Original file line number Diff line number Diff line change
1
+ { inputs , ... } :
2
+
1
3
{
2
4
perSystem =
3
- { config , lib , ... } :
4
5
{
5
- devShells = lib . pipe ( config . packages ) [
6
- ( lib . concatMapAttrs
7
- ( name : package : {
8
- ${ name } = package . passthru . shell or null ;
9
- } ) )
10
- ( lib . filterAttrs ( name : value : value != null ) )
11
- ] ;
6
+ config ,
7
+ lib ,
8
+ system ,
9
+ ...
10
+ } :
11
+ {
12
+ devShells =
13
+ let
14
+ pkgs = import inputs . nixpkgs { inherit system ; } ;
15
+ stdenv = pkgs . stdenv ;
16
+ scripts = config . packages . python-scripts ;
17
+ in
18
+ lib . pipe ( config . packages ) [
19
+ ( lib . concatMapAttrs (
20
+ name : package : {
21
+ ${ name } = pkgs . mkShell {
22
+ name = "${ name } " ;
23
+ inputsFrom = [ package ] ;
24
+ shellHook = ''
25
+ echo "Entering ${ name } devShell"
26
+ '' ;
27
+ } ;
28
+ "${ name } -extra" =
29
+ if ( name == "python-scripts" ) then
30
+ null
31
+ else
32
+ pkgs . mkShell {
33
+ name = "${ name } -extra" ;
34
+ inputsFrom = [
35
+ package
36
+ scripts
37
+ ] ;
38
+ shellHook = ''
39
+ echo "Entering ${ name } devShell"
40
+ addToSearchPath "LD_LIBRARY_PATH" "${ lib . getLib stdenv . cc . cc } /lib"
41
+ '' ;
42
+ } ;
43
+ }
44
+ ) )
45
+ ( lib . filterAttrs ( name : value : value != null ) )
46
+ ] ;
12
47
} ;
13
48
}
14
-
Original file line number Diff line number Diff line change 20
20
vulkan-loader ,
21
21
curl ,
22
22
shaderc ,
23
- useBlas ? builtins . all ( x : ! x ) [
24
- useCuda
25
- useMetalKit
26
- useRocm
27
- useVulkan
28
- ] && blas . meta . available ,
23
+ useBlas ?
24
+ builtins . all ( x : ! x ) [
25
+ useCuda
26
+ useMetalKit
27
+ useRocm
28
+ useVulkan
29
+ ]
30
+ && blas . meta . available ,
29
31
useCuda ? config . cudaSupport ,
30
32
useMetalKit ? stdenv . isAarch64 && stdenv . isDarwin ,
31
33
# Increases the runtime closure size by ~700M
@@ -214,25 +216,6 @@ effectiveStdenv.mkDerivation (finalAttrs: {
214
216
cp $src/include/llama.h $out/include/
215
217
'' ;
216
218
217
- # Define the shells here, but don't add in the inputsFrom to avoid recursion.
218
- passthru = {
219
- inherit
220
- useBlas
221
- useCuda
222
- useMetalKit
223
- useMpi
224
- useRocm
225
- useVulkan
226
- ;
227
-
228
- shell = mkShell {
229
- name = "shell-${ finalAttrs . finalPackage . name } " ;
230
- description = "contains numpy and sentencepiece" ;
231
- nativeBuildInputs = [ cmake ] ;
232
- inputsFrom = [ finalAttrs . finalPackage ] ;
233
- } ;
234
- } ;
235
-
236
219
meta = {
237
220
# Configurations we don't want even the CI to evaluate. Results in the
238
221
# "unsupported platform" messages. This is mostly a no-op, because
Original file line number Diff line number Diff line change 3
3
stdenv ,
4
4
buildPythonPackage ,
5
5
poetry-core ,
6
- breakpointHook ,
7
6
mkShell ,
8
7
python3Packages ,
9
8
gguf-py ,
18
17
torchWithoutCuda
19
18
gguf-py
20
19
tqdm
20
+
21
+ # for scripts/compare-llama-bench.py
22
+ gitpython
23
+ tabulate
24
+
25
+ # for examples/pydantic-models-to-grammar-examples.py
26
+ docstring-parser
27
+ pydantic
28
+
29
+ ] ;
30
+
31
+ llama-python-test-deps = with python3Packages ; [
32
+ # Server bench
33
+ matplotlib
34
+
35
+ # server tests
36
+ openai
37
+ behave
38
+ prometheus-client
21
39
] ;
22
40
in
23
41
@@ -43,16 +61,6 @@ buildPythonPackage ({
43
61
src = lib . cleanSource ../../. ;
44
62
} ;
45
63
nativeBuildInputs = [ poetry-core ] ;
64
+ nativeCheckInputs = llama-python-test-deps ;
46
65
dependencies = llama-python-deps ;
47
-
48
- passthru = {
49
- shell = mkShell {
50
- name = "shell-python-scripts" ;
51
- description = "contains numpy and sentencepiece" ;
52
- buildInputs = llama-python-deps ;
53
- shellHook = ''
54
- addToSearchPath "LD_LIBRARY_PATH" "${ lib . getLib stdenv . cc . cc } /lib"
55
- '' ;
56
- } ;
57
- } ;
58
66
} )
You can’t perform that action at this time.
0 commit comments