OpenNMT

Error using GPT-2

Hello
i was try to use GPT2Small model with command

onmt-main --model_type GPT2Small --config data.yml --auto_config train --with_eval

i found error:

AttributeError: ‘LanguageModelInputter’ object has no attribute ‘features_inputter’

my data.yml

model_dir: run/

data:
train_features_file: data/src-train.txt
train_labels_file: data/tgt-train.txt
eval_features_file: data/src-val.txt
eval_labels_file: data/tgt-val.txt
vocabulary: data/src-vocab.txt
target_vocabulary: data/tgt-vocab.txt

train:
max_step: 10000

Hi,

You should only configure the “features” fields and a single vocabulary to use GPT-2, which is a language model. So remove the following fields from the configuration:

  • train_labels_file
  • eval_labels_file
  • target_vocabulary
1 Like

thank you Kein, all done!