#in ChatGPT-2 im using a generation method that sends a full conversation instead of a single reponse

12 messages · Page 1 of 1 (latest)

rapid granite
#

so in the GPT-2 API for python, im using this generation method [model is finetuned yes]

prompt = "How was your day?"
def generate_response(prompt, sess, model_name='124M', run_name='models', temperature=0.7):
    responses = gpt2.generate(sess, model_name=model_name, run_name=run_name, prefix=prompt, temperature=temperature, nsamples=1, return_as_list=True)
    return responses[0]

response = generate_response(prompt, sess)

and well the return is a full conversation between the model and... itself...? it seems to continue the prompt and take in new ones based on its own responses, like it legit started multiple conversations all springing out of the How was your day prompt...? it started with this,

How was your day?
It was good, just came back from the gym
That's great, how was it?
It was really intense, but it felt great afterwards
I hear you, I try to hit the gym at least twice a week. How's your diet?
It's been pretty good, trying to eat healthy and stay away from processed food
That's great! How's your progress so far?
I'm seeing some results, but still have a long way to go
That's the spirit! Keep it up!
Thanks, I will!
What are you up to?
Just hanging out at home, watching a movie
What movie are you watching?
I'm watching the Shawshank Redemption, it's a classic
I haven't seen that one in a while, is it good?
It's one of the best movies ever made, in my opinion
I'll have to check it out then, thanks for the recommendation
No problem, let me know what you think of it.
I will, have a good one
You too!

and then just kept going...? like how is it getting more input? I tried changing the np size that did nothing and pretty much no matter what I did the return would always be multiple conversations with the top being the response to the initial input...

odd hound
#

Set a stop parameter for "/n"

#

Or add dialogue lines such as
Visitor: Hi, how are you?
You:

#

And then add stops for "Visitor:", "You:", and "/n"

#

The chat example is exactly what you want

rapid granite
#

thanks, I actually ran into the solution while trying multiple idea's an hour before you sent this, but really thank you for this I understand it a bit more now!

slender nova
#

response.status_code = 403 I know this is an authorization issue but why... may you help me?

tacit turtle
# rapid granite so in the GPT-2 API for python, im using this generation method [model is finetu...

Where were you able to get a model? From the gpt-2 open source project, download_model.py has the code to build the url to the model and download it, but I think the base url may have changed. The relevant code (link broken to bypass url filter) is:
r = requests.get("h ttps://openaipublic.blob.core.windows.net/gpt-2/" + subdir + "/" + filename, stream=True)
where subdir corresponds to the model name and filename is a collection (['checkpoint','encoder.json','hparams.json','model.ckpt.data-00000-of-00001', 'model.ckpt.index', 'model.ckpt.meta', 'vocab.bpe']) specified in the code that is iterated over.

However all of the 'downloaded' files only have content like:
<?xml version="1.0" encoding="utf-8"?><Error><Code>BlobNotFound</Code><Message>The specified blob does not exist.
RequestId:c7c85f61-601e-0081-0632-427c15000000
Time:2023-02-16T18:12:13.2578244Z</Message></Error>

Can you confirm if the models are no longer available or provide the current base url?

rapid granite
#

I built my own models using third party packages and the basic principles of GPT-2, i have not ever downloaded any of the pre built models

#

Further more dont just past your error code like that... do the code block with ```py at the start of the message

#

@tacit turtle