rish-16/gpt2client

UnboundLocalError: local variable 'generated' referenced before assignment

Closed this issue · 3 comments

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):

  • OS: [ Windows]

I'm getting the same error.

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

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