rish-16 / gpt2client

✍🏻 gpt2-client: Easy-to-use TensorFlow Wrapper for GPT-2 117M, 345M, 774M, and 1.5B Transformer Models 🤖 📝
MIT License
372 stars 74 forks source link

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

Open rickwierenga opened 4 years ago

rickwierenga commented 4 years ago

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

rish-16 commented 4 years ago

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

rish-16 commented 4 years ago

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!

rickwierenga commented 4 years ago
AttributeError: 'GPT2Client' object has no attribute 'load_model'

This should probably be fixed in the README too.

rish-16 commented 4 years ago

I'll go check it out thanks