1. - Top - End - #38
    Ettin in the Playground
    Join Date
    Dec 2010

    Default Re: Help a non-programmer install GPT-2 (and its prerequisites)

    It looks like maybe you dropped an indent. Instead of:

    Code:
            for _ in range(nsamples // batch_size):
                out = sess.run(output, feed_dict={
    			context: [context_tokens for _ in range(batch_size)]
    		})[:, len(context_tokens):]
            for i in range(batch_size):
                generated += 1
                text = enc.decode(out[i])
                print("=" * 40 + " SAMPLE " + str(generated) + " " + "=" * 40)
                print(text)
    I think maybe it should be:

    Code:
            for _ in range(nsamples // batch_size):
                out = sess.run(output, feed_dict={
    			context: [context_tokens for _ in range(batch_size)]
    		})[:, len(context_tokens):]
                for i in range(batch_size):
                    generated += 1
                    text = enc.decode(out[i])
                    print("=" * 40 + " SAMPLE " + str(generated) + " " + "=" * 40)
                    print(text)
    That second 'for' should be at the same indentation level as 'out = ...'
    Last edited by NichG; 2021-03-28 at 08:54 PM.