0

Hope you all are doing good , I am working on fine tuning GPT 2 model to generate Title based on the content ,While working on it ,I have created a simple CSV files containing only the title to train the model , But while inputting this model to GPT 2 for fine tuning I am getting the following ERROR , JSONDecodeError Traceback (most recent call last) in () 10 steps=1000, 11 save_every=200, ---> 12 sample_every=25) # steps is max number of training steps 13 14 # gpt2.generate(sess)

    3 frames
    /usr/lib/python3.7/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
        336         if s.startswith('\ufeff'):
        337           s = s.encode('utf8')[3:].decode('utf8')
    --> 338             # raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
        339             #                       s, 0)
        340     else:
    
    JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
    
    Below is my code for the above :
    
    import gpt_2_simple as gpt2
    
    model_name = "120M" # "355M" for larger model (it's 1.4 GB)
    gpt2.download_gpt2(model_name=model_name)   # model is saved into current directory under /models/117M/
    sess = gpt2.start_tf_sess()
    
    gpt2.finetune(sess,
                  'titles.csv',
                  model_name=model_name,
                  steps=1000,
                  save_every=200,
                  sample_every=25)   # steps is max number of training steps
    
    I have tried all the basic mechanism of handing UTF -8 BOM but did not find any luck ,Hence requesting your help .It would be a great help from you all .
Harry DSOUZA
  • 27
  • 1
  • 2

1 Answers1

-1

Try changing the model name because i see you input 120M and the gpt2 model is called 124M