pythonPackages.spacy: add models data attr set
Model Version es_core_web_md 1.0.0 fr_depvec_web_lg 1.0.0 en_core_web_md 1.2.1 en_depent_web_md 1.2.1 en_core_web_sm 1.2.0 de_core_news_md 1.0.0 en_vectors_glove_md 1.0.0
This commit is contained in:
26
pkgs/development/python-modules/spacy/models.nix
Normal file
26
pkgs/development/python-modules/spacy/models.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ stdenv, buildPythonPackage, fetchurl, spacy }:
|
||||
let
|
||||
buildModelPackage = { pname, version, sha256, license }: buildPythonPackage {
|
||||
name = "${pname}-${version}";
|
||||
inherit pname version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/explosion/spacy-models/releases/download/${pname}-${version}/${pname}-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ spacy ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Models for the spaCy NLP library";
|
||||
homepage = "https://github.com/explosion/spacy-models";
|
||||
license = licenses."${license}";
|
||||
maintainers = with maintainers; [ rvl ];
|
||||
};
|
||||
};
|
||||
|
||||
makeModelSet = models: with pkgs.lib; listToAttrs (map (m: nameValuePair m.pname (buildModelPackage m)) models);
|
||||
|
||||
in makeModelSet (pkgs.lib.importJSON ./models.json)
|
||||
|
||||
# cat models.json | jq -r '.[] | @uri "https://github.com/explosion/spacy-models/releases/download/\(.pname)-\(.version)/\(.pname)-\(.version).tar.gz"' | xargs -n1 nix-prefetch-url
|
||||
Reference in New Issue
Block a user