nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 huggingface-hub,
11 onnxruntime,
12 sentencepiece,
13 torch,
14 tqdm,
15 transformers,
16}:
17
18buildPythonPackage rec {
19 pname = "gliner";
20 version = "0.2.24";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "urchade";
25 repo = "GLiNER";
26 tag = "v${version}";
27 hash = "sha256-6kSt+c2UT0rvJDFHzRPTDffBG9X/2Mxs7RSZVgWG7jo=";
28 };
29
30 build-system = [
31 setuptools
32 ];
33
34 pythonRelaxDeps = [
35 "transformers"
36 ];
37 dependencies = [
38 huggingface-hub
39 onnxruntime
40 sentencepiece
41 torch
42 tqdm
43 transformers
44 ];
45
46 pythonImportsCheck = [ "gliner" ];
47
48 # All tests require internet
49 doCheck = false;
50
51 meta = {
52 description = "Generalist and Lightweight Model for Named Entity Recognition";
53 homepage = "https://github.com/urchade/GLiNER";
54 changelog = "https://github.com/urchade/GLiNER/releases/tag/${src.tag}";
55 license = lib.licenses.asl20;
56 maintainers = with lib.maintainers; [ GaetanLepage ];
57 badPlatforms = [
58 # terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException'
59 # Attempt to use DefaultLogger but none has been registered.
60 "aarch64-linux"
61 ];
62 };
63}