from transformers import GPT2Config | |
import os | |
config_type = os.environ.get("CONFIG_TYPE") | |
dataset_name = os.environ.get("DATASET") | |
dataset_config = os.environ.get("DATASET_CONFIG") | |
dataset_split = os.environ.get("DATASET_SPLIT") | |
vocab_size = int(os.environ.get("VOCAB_SIZE")) | |
model_path = os.environ.get("MODEL_PATH") | |
config = GPT2Config.from_pretrained(config_type, resid_pdrop=0.0, embd_pdrop=0.0, attn_pdrop=0.0, vocab_size=vocab_size) | |
config.save_pretrained(model_path) | |