gpt2client icon indicating copy to clipboard operation
gpt2client copied to clipboard

FileNotFoundError: [Errno 2] No such file or directory: 'models/117M/encoder.json'

Open rickwierenga opened this issue 6 years ago • 4 comments

Code:

from gpt2_client import GPT2Client
gpt2 = GPT2Client('117M')
gpt2.generate(interactive=True)

Crash:

FileNotFoundError: [Errno 2] No such file or directory: 'models/117M/encoder.json'

This error occurs for every model.

macOS Catalina 10.15

rickwierenga avatar Nov 11 '19 20:11 rickwierenga

Hello there, I'll look into this at once. Thank you for highlighting this

rish-16 avatar Nov 13 '19 11:11 rish-16

Hey there, You need to download the model first. Try out this code snippet:

from gpt2_client import GPT2Client

gpt2 = GPT2Client('117M')
gpt2.load_model() # if you already have the model checkpoints, then it will automatically search for it and use them
gpt2.generate(interactive=True)

Hope this helps!

rish-16 avatar Nov 13 '19 11:11 rish-16

AttributeError: 'GPT2Client' object has no attribute 'load_model'

This should probably be fixed in the README too.

rickwierenga avatar Nov 13 '19 20:11 rickwierenga

I'll go check it out thanks

rish-16 avatar Nov 14 '19 05:11 rish-16