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

UnboundLocalError: local variable 'generated' referenced before assignment #30

Closed codecrust closed 4 years ago

codecrust commented 4 years ago

Describe the bug After generating the text once it always throws this error

File "C:\Users\hp\AppData\Roaming\Python\Python37\site-packages\gpt2_client\gpt2_client.py", line 154, in generate while n_samples == 0 or generated < n_samples: UnboundLocalError: local variable 'generated' referenced before assignment

Additional code for python program:

from gpt2_client import GPT2Client

gpt2 = GPT2Client('117M') # This could also be `345M`, `774M`, or `1558M`
gpt2.load_model()

gpt2.generate(interactive=True) # Asks user for prompt
gpt2.generate(n_samples=1) # Generates 1 pieces of text

Desktop (please complete the following information):

xDsquare commented 4 years ago

I'm getting the same error.

rish-16 commented 4 years ago

Hey, thanks for the headsup. Was planning on sunsetting this project but will fix this issue :)

rish-16 commented 4 years ago

Hey,

A patch was just written for this. Will keep you posted on progress. This error won't be thrown again.

Thanks for your patience :D