gpt-engineer
gpt-engineer copied to clipboard
Application Ends Prematurely
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
I can replicate
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.
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.
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.
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.
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):
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 we have solved it here: https://github.com/AntonOsika/gpt-engineer/issues/35#issuecomment-1595150292
If you wish to reopen the issue please do following the new issue template.