Describe the bug
Trying to test on the Google Colab as per readme instructions.
To Reproduce
Steps to reproduce the behavior:
Executed
pip install gpt2-client
Executed
from gpt2_client import GPT2Client
gpt2 = GPT2Client('117M', save_dir='models')
gpt2.load_model(force_download=False)
Executed
from gpt2_client import GPT2Client
gpt2 = GPT2Client('117M')
gpt2.generate(interactive=True)
gpt2.generate(n_samples=4)
text = gpt.generate(return_text=True)
gpt2.generate(interactive=True, n_samples=3)
Expected behavior
Expected a prompt to return then some sort of generated text.
Instead the script processes for a time then crashes returning gibberish along with:
UnboundLocalError Traceback (most recent call last)
<ipython-input-4-40d470866eb3> in <module>()
5
6 gpt2.generate(interactive=True) # Asks user for prompt
----> 7 gpt2.generate(n_samples=4) # Generates 4 pieces of text
8 text = gpt.generate(return_text=True) # Generates text and returns it in an array
9 gpt2.generate(interactive=True, n_samples=3) # A different prompt each time
/usr/local/lib/python3.6/dist-packages/gpt2_client/gpt2_client.py in generate(self, interactive, n_samples, words, display, return_text)
150 print (colored('Generating sample...', 'yellow'))
151
--> 152 while n_samples == 0 or generated < n_samples:
153 out = sess.run(output)
154 for i in range(batch_size):
UnboundLocalError: local variable 'generated' referenced before assignment
Describe the bug Trying to test on the Google Colab as per readme instructions.
To Reproduce Steps to reproduce the behavior:
Expected behavior Expected a prompt to return then some sort of generated text. Instead the script processes for a time then crashes returning gibberish along with:
Screenshots