-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from TomNong/GPT-2-refined
Gpt 2 refined
- Loading branch information
Showing
9 changed files
with
38 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Configuration files of GPT-2 models in Texar style. | ||
|
||
For example, `config_model.py` is the Texar configuration file corresponding to the `model_117M` model downloaded from [GPT-2 official release](https://github.com/openai/gpt-2). |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...pt-2/gpt2_config_lib/config_model_117M.py → examples/gpt-2/configs/config_model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
#!/bin/sh | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "You must enter the model name as a parameter, e.g.: sh gpt2_pretrained_models/download_model.sh 117M" | ||
echo "You must enter the model name as a parameter, e.g.: sh gpt2_pretrained_models/download_model.sh model_117M" | ||
exit 1 | ||
fi | ||
|
||
model=$1 | ||
|
||
model_name=${model#*_} | ||
mkdir -p gpt2_pretrained_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 | ||
fetch=$model_name/$filename | ||
sub_path=$model/$filename | ||
echo "Fetching $fetch" | ||
curl --output gpt2_pretrained_models/$fetch https://storage.googleapis.com/gpt-2/models/$fetch | ||
curl --output gpt2_pretrained_models/$sub_path https://storage.googleapis.com/gpt-2/models/$fetch | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
""" | ||
Byte pair encoding utilities | ||
|