Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem in generate_hard_instruction.py #5

Open
better629 opened this issue Jun 5, 2023 · 2 comments
Open

problem in generate_hard_instruction.py #5

better629 opened this issue Jun 5, 2023 · 2 comments
Labels
question Further information is requested

Comments

@better629
Copy link

in function post_process_gpt3_response

    instruction_match = re.search(r"Instruction: (.+)\n", raw_instructions)
    if instruction_match:
        instruction = instruction_match.group(1)
    else:
        return []

raw_instructions is the response of chatgpt.
And it uses string like Instruction: xx\nInput: <noinput>\n\n#Created Prompt# to call gpt to generate new instruction.
But it seems that it won't contain Instruction: in the gpt response, only the new instruction. So it will allways return [] and cause while loop never stop.

Is there a problem or not? @YJiangcm

@YJiangcm
Copy link
Owner

YJiangcm commented Jun 6, 2023

Hi, in most cases, the gpt response contains strings like Instruction: xxx\nInput: xxx. So we use re.search(r"Instruction: (.+)\n", raw_instructions) to extract the generated instruction.

However, in some cases, the response will not contain the string Instruction: and Input: , so we discard the generated rsponse by return []. Hope this addresses your concerns.

@YJiangcm YJiangcm added the question Further information is requested label Jun 6, 2023
@better629
Copy link
Author

better629 commented Jun 6, 2023

@YJiangcm
I think maybe the prompt Instruction: xx\nInput: <noinput>\n\n#Created Prompt# to the gpt is not directly( I have tried times, but can't response as except). Maybe update the prompt like ask it to generate new prompt as your format is more helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants