summary refs log tree commit diff
path: root/pkgs/tools/text
diff options
context:
space:
mode:
authorJonathan Ringer <jonringer117@gmail.com>2021-05-20 22:39:34 -0700
committerJonathan Ringer <jonringer@users.noreply.github.com>2021-05-21 18:13:24 -0700
commit3f32731630f579f5e09681110e5744b60639acbc (patch)
tree0884d6553ec4bc87eef3247ebbaeff292b85865a /pkgs/tools/text
parentb4fd56d50b3caeb21b672cf5c8f6f2aa70173840 (diff)
downloadnixpkgs-3f32731630f579f5e09681110e5744b60639acbc.tar
nixpkgs-3f32731630f579f5e09681110e5744b60639acbc.tar.gz
nixpkgs-3f32731630f579f5e09681110e5744b60639acbc.tar.bz2
nixpkgs-3f32731630f579f5e09681110e5744b60639acbc.tar.lz
nixpkgs-3f32731630f579f5e09681110e5744b60639acbc.tar.xz
nixpkgs-3f32731630f579f5e09681110e5744b60639acbc.tar.zst
nixpkgs-3f32731630f579f5e09681110e5744b60639acbc.zip
gpt2tc: 2020-12-30 -> 2021-04-24, fix build
Diffstat (limited to 'pkgs/tools/text')
-rw-r--r--pkgs/tools/text/gpt2tc/0002-fix-download-url.patch11
-rw-r--r--pkgs/tools/text/gpt2tc/default.nix13
2 files changed, 5 insertions, 19 deletions
diff --git a/pkgs/tools/text/gpt2tc/0002-fix-download-url.patch b/pkgs/tools/text/gpt2tc/0002-fix-download-url.patch
deleted file mode 100644
index fd8f93834e5..00000000000
--- a/pkgs/tools/text/gpt2tc/0002-fix-download-url.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff --git a/download_model.sh b/download_model.sh
-index 9cb401f..ad1dc62 100755
---- a/download_model.sh
-+++ b/download_model.sh
-@@ -13,5 +13,5 @@ mkdir -p models/$model
- for filename in checkpoint encoder.json hparams.json model.ckpt.data-00000-of-00001 model.ckpt.index model.ckpt.meta vocab.bpe; do
-   fetch=$model/$filename
-   echo "Fetching $fetch"
--  curl --output models/$fetch https://storage.googleapis.com/gpt-2/models/$fetch
-+  curl --output models/$fetch https://openaipublic.blob.core.windows.net/gpt-2/models/$fetch
- done
diff --git a/pkgs/tools/text/gpt2tc/default.nix b/pkgs/tools/text/gpt2tc/default.nix
index eb79d9009f3..3714a418548 100644
--- a/pkgs/tools/text/gpt2tc/default.nix
+++ b/pkgs/tools/text/gpt2tc/default.nix
@@ -2,20 +2,17 @@
 
 stdenv.mkDerivation rec {
   pname = "gpt2tc";
-  version = "2020-12-30";
+  version = "2021-04-24";
 
   src = fetchurl {
-    url = "https://bellard.org/nncp/gpt2tc-${version}.tar.gz";
-    hash = "sha256-KFcl7E6iGx50JaJI1jwzKAdkrkbNngPbrEA/ZSyG+uY=";
+    url = "https://bellard.org/libnc/gpt2tc-${version}.tar.gz";
+    hash = "sha256-kHnRziSNRewifM/oKDQwG27rXRvntuUUX8M+PUNHpA4=";
   };
 
   patches = [
     # Add a shebang to the python script so that nix detects it as such and
     # wraps it properly. Otherwise, it runs in shell and freezes the system.
     ./0001-add-python-shebang.patch
-
-    # Update the source URL for the models because the old one is down.
-    ./0002-fix-download-url.patch
   ];
 
   nativeBuildInputs = [ autoPatchelfHook ];
@@ -24,11 +21,11 @@ stdenv.mkDerivation rec {
     (python3.withPackages (p: with p; [ numpy tensorflow ]))
   ];
 
-  dontBuild = true;
-
   installPhase = ''
     runHook preInstall
 
+    install -D -m755 -t $out/lib libnc${stdenv.hostPlatform.extensions.sharedLibrary}
+    addAutoPatchelfSearchPath $out/lib
     install -D -m755 -t $out/bin gpt2tc
     install -T -m755 download_model.sh $out/bin/gpt2-download-model
     install -T -m755 gpt2convert.py $out/bin/gpt2-convert