From 0aad2ab3f427051eed286fb0f70c3b7214551ad2 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Sat, 16 Feb 2019 10:32:30 -0500 Subject: [PATCH] Fetch model using curl, add shebang to download_files.sh and mark it executable --- README.md | 2 +- download_model.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) mode change 100644 => 100755 download_model.sh diff --git a/README.md b/README.md index 5690072..b079345 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ See more details in our [blog post](https://blog.openai.com/better-language-mode ## Installation -Download the model data (needs [gsutil](https://cloud.google.com/storage/docs/gsutil_install)): +Download the model data ``` sh download_model.sh 117M ``` diff --git a/download_model.sh b/download_model.sh old mode 100644 new mode 100755 index 0d4a4fa..690463f --- a/download_model.sh +++ b/download_model.sh @@ -1,3 +1,5 @@ +#!/bin/sh + if [ "$#" -ne 1 ]; then echo "You must enter the model name as a parameter, e.g.: sh download_model.sh 117M" exit 1 @@ -9,5 +11,7 @@ mkdir -p models/$model # TODO: gsutil rsync -r gs://gpt-2/models/ models/ for filename in checkpoint encoder.json hparams.json model.ckpt.data-00000-of-00001 model.ckpt.index model.ckpt.meta vocab.bpe; do - gsutil cp gs://gpt-2/models/$model/$filename models/$model + fetch=$model/$filename + echo "Fetching $fetch" + curl --output models/$fetch https://storage.googleapis.com/gpt-2/models/$fetch done