gpt2tc: 2020-12-30 -> 2021-04-24, fix build

This commit is contained in:
Jonathan Ringer 2021-05-20 22:39:34 -07:00 committed by Jonathan Ringer
parent b4fd56d50b
commit 3f32731630
2 changed files with 5 additions and 19 deletions

View file

@ -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

View file

@ -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