0

I am trying to generate text using the GPT-2 language model using the gpt2-simple library. The training process worked fine, but I am running into an error when I try to generate text using the generate() function. The error message I am receiving is:

"Container localhost does not exist. (Could not find resource: localhost/model/wpe)"

I am not sure what is causing this error, and I have not been able to find any relevant information in the documentation or online forums. Any help in resolving this issue would be greatly appreciated.

Here is the code i am using to generate data.

import gpt_2_simple as gpt2
import os
import re
from chatbot import Chat, register_call,demo
import uwuify
import tensorflow as tf
import numpy as np
from transformers import GPT2LMHeadModel, GPT2Tokenizer,AutoModel,AutoTokenizer
name = 'Fluffy the femboy'
# Load pre-trained model and tokenizer
model_name = "124M"
file_name = "data.txt"
def generate(input):
    global sess
    thingy = True
    sess = gpt2.start_tf_sess()
    meow = gpt2.generate(sess)#,prefix=input,temperature=0.727)
    print(meow)
    thingy = False

generate(f"Hello!")

Expected result: I expect the generate() function to generate text without any errors.

Actual result: I am receiving the following error message:

"Container localhost does not exist. (Could not find resource: localhost/model/wpe)"

Additional information:

I am using the latest version of the gpt2-simple library.
I am using python 3.11
I am running this code on a Windows machine.
Kit
  • 1
  • 1

0 Answers0