gpt-engineer icon indicating copy to clipboard operation
gpt-engineer copied to clipboard

Application Ends Prematurely

Open WizKid1968 opened this issue 2 years ago • 8 comments

It keeps ending after "Now let's proceed with the file contents.", any thoughts?

I'm running gpt-3.5-turbo-16k Using a Mac Book Air M1

WizKid1968 avatar Jun 14 '23 17:06 WizKid1968

I can replicate

patillacode avatar Jun 14 '23 22:06 patillacode

I was getting output before but now all I get is the description of what will be made and then the statement: "Now, let's proceed with the implementation of each file starting with the entrypoint file, which in this case will be main.py." like above.

jebarpg avatar Jun 15 '23 03:06 jebarpg

okay so I just changed my model from gpt-3.5-turbo-0613 to just gpt-3.5-turbo and I am getting output again. So there is something to do with the model you choose... but I was getting output with gpt-3.5-turbo-0613 before... just not now.

jebarpg avatar Jun 15 '23 03:06 jebarpg

i have the same problem. i changed from gpt-3.5-turbo to gpt-3.5-turbo-16k because with gpt-3.5-turbo all the files get put into one document file. but now its even worst as its not even creating anything now. so idk what to do.

DrMemoryFish avatar Jun 15 '23 05:06 DrMemoryFish

I am. inclined to think that the model in question affects in a great manner to how this works, meaning GPT-4 is much more capable of understanding what is being done here and anything below it is just best effort...

I guess we cannot really put this to work "out of the box" unless we get access to GPT-4 or maybe a bit of prompt modification.

patillacode avatar Jun 15 '23 08:06 patillacode

i have the same problem. i changed from gpt-3.5-turbo to gpt-3.5-turbo-16k because with gpt-3.5-turbo all the files get put into one document file. but now its even worst as its not even creating anything now. so idk what to do.

Heres my solution:

import re
import os

save_dir = "results/"
f = open("example/workspace/all_output.txt", "r")
s = f.read()
#pattern = re.compile(r'^\*\*(.*?\.py)\*\*\s+```python\s+.*?(^(?:.*\n)*?)^```\s*', re.MULTILINE) #Example **game.py**
#pattern = re.compile(r'^(.*?\.py):\s+```python\s+.*?(^(?:.*\n)*?)^```\s*', re.MULTILINE) #Example game.py:
pattern = re.compile(r'^.*?\((.*?\.py)\):\s+```python\s+.*?(^(?:.*\n)*?)^```\s*', re.MULTILINE) #Example Game File (game.py):
os.makedirs(save_dir, exist_ok=True)
for (file_name, file_text) in re.findall(pattern, s):
    write_file = open(save_dir + file_name, "w")
    write_file.write(file_text)
    write_file.close()
    print(file_name, "\n")

but sometimes you have to change the regex because the output isn't always the same. so if you see **game.py** use: #pattern = re.compile(r'^\*\*(.*?\.py)\*\*\s+```python\s+.*?(^(?:.*\n)*?)^```\s*', re.MULTILINE) #Example **game.py** if you see game.py: then use this: pattern = re.compile(r'^(.*?\.py):\s+```python\s+.*?(^(?:.*\n)*?)^```\s', re.MULTILINE) if you see 'Game file (game.py)' use: pattern = re.compile(r'^.*?\((.*?\.py)\):\s+```python\s+.*?(^(?:.*\n)*?)^```\s*', re.MULTILINE) #Example Game File (game.py):

jebarpg avatar Jun 15 '23 15:06 jebarpg

i have the same problem. i changed from gpt-3.5-turbo to gpt-3.5-turbo-16k because with gpt-3.5-turbo all the files get put into one document file. but now its even worst as its not even creating anything now. so idk what to do.

Heres my solution:

import re
import os

save_dir = "results/"
f = open("example/workspace/all_output.txt", "r")
s = f.read()
#pattern = re.compile(r'^\*\*(.*?\.py)\*\*\s+```python\s+.*?(^(?:.*\n)*?)^```\s*', re.MULTILINE) #Example **game.py**
#pattern = re.compile(r'^(.*?\.py):\s+```python\s+.*?(^(?:.*\n)*?)^```\s*', re.MULTILINE) #Example game.py:
pattern = re.compile(r'^.*?\((.*?\.py)\):\s+```python\s+.*?(^(?:.*\n)*?)^```\s*', re.MULTILINE) #Example Game File (game.py):
os.makedirs(save_dir, exist_ok=True)
for (file_name, file_text) in re.findall(pattern, s):
    write_file = open(save_dir + file_name, "w")
    write_file.write(file_text)
    write_file.close()
    print(file_name, "\n")

but sometimes you have to change the regex because the output isn't always the same. so if you see game.py use: #pattern = re.compile(r'^\*\*(.*?\.py)\*\*\s+```python\s+.*?(^(?:.*\n)*?)^```\s*', re.MULTILINE) #Example **game.py** if you see game.py: then use this: pattern = re.compile(r'^(.*?\.py):\s+```python\s+.*?(^(?:.*\n)*?)^```\s', re.MULTILINE) if you see 'Game file (game.py)' use: pattern = re.compile(r'^.*?\((.*?\.py)\):\s+```python\s+.*?(^(?:.*\n)*?)^```\s*', re.MULTILINE) #Example Game File (game.py):

That's seems like a solution for only those who wants to build a snake game. Not very practical.

WizKid1968 avatar Jun 16 '23 14:06 WizKid1968

@WizKid1968 we have solved it here: https://github.com/AntonOsika/gpt-engineer/issues/35#issuecomment-1595150292

jebarpg avatar Jun 17 '23 02:06 jebarpg

If you wish to reopen the issue please do following the new issue template.

patillacode avatar Jun 21 '23 12:06 patillacode