From 3f32731630f579f5e09681110e5744b60639acbc Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Thu, 20 May 2021 22:39:34 -0700 Subject: [PATCH] gpt2tc: 2020-12-30 -> 2021-04-24, fix build --- pkgs/tools/text/gpt2tc/0002-fix-download-url.patch | 11 ----------- pkgs/tools/text/gpt2tc/default.nix | 13 +++++-------- 2 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 pkgs/tools/text/gpt2tc/0002-fix-download-url.patch 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