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

Fixed OPENAI model deprecated issue by changing model names #143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AurganicSubstance
Copy link

Issue #141 has many people recently report TOKEN LIMIT EXCEEDED error.

I discovered that the issue is because on Jan 4th 2024 OpenAI stopped all models with names such as "text-davinci-00x" (x=123). (see: https://platform.openai.com/docs/deprecations).

Hence I searched through entire project for key word "davinci" and replace all of them to "gpt-3.5-turbo-instruct".

Additionally, since TOKEN LIMIT EXCEEDED error contains more than token limit error (since any other openai/network error all get concluded as TOKEN LIMIT EXCEEDED), I changed the Except clause in gpt_structure.py to print out the full error msg for better debugging

@alextveit
Copy link

Issue #141 has many people recently report TOKEN LIMIT EXCEEDED error.

I discovered that the issue is because on Jan 4th 2024 OpenAI stopped all models with names such as "text-davinci-00x" (x=123). (see: https://platform.openai.com/docs/deprecations).

Hence I searched through entire project for key word "davinci" and replace all of them to "gpt-3.5-turbo-instruct".

Additionally, since TOKEN LIMIT EXCEEDED error contains more than token limit error (since any other openai/network error all get concluded as TOKEN LIMIT EXCEEDED), I changed the Except clause in gpt_structure.py to print out the full error msg for better debugging

Are there specific files, or a change that needs to be done through almost all files?

@AurganicSubstance
Copy link
Author

Issue #141 has many people recently report TOKEN LIMIT EXCEEDED error.
I discovered that the issue is because on Jan 4th 2024 OpenAI stopped all models with names such as "text-davinci-00x" (x=123). (see: https://platform.openai.com/docs/deprecations).
Hence I searched through entire project for key word "davinci" and replace all of them to "gpt-3.5-turbo-instruct".
Additionally, since TOKEN LIMIT EXCEEDED error contains more than token limit error (since any other openai/network error all get concluded as TOKEN LIMIT EXCEEDED), I changed the Except clause in gpt_structure.py to print out the full error msg for better debugging

Are there specific files, or a change that needs to be done through almost all files?

image
these 3

@AurganicSubstance
Copy link
Author

that thomas liang commit is by me so you can also just view the commit and changed files directly

@justtiberio
Copy link

@AurganicSubstance Thank you very much for your help! I did alter the files you changed and it seems to work now, I don't get the token error anymore. But is your simulation working? When I try to run I open the http://localhost:8000/simulator_home and when I run the simulation nothing happens on the page, it continues frozen and showing all characters with the same sprite. The terminal shows the simulation is running but in the webpage nothing happens, and If I try to click on something too see the details of the characters also nothing, and when I try to go back to the main page (simulator_home) I get an error, the page only loads a text saying "Please start the backend firs.".

According to the README the page http://localhost:8000/simulator_home should show the character moving and interacting while the simulation runs, but when my simulation runs the page doesn't change, neither does the replay when I try to access them, I click play and nothing happens. And every time my simulation ends, before I can enter another command, the terminal gives me this error:

Traceback (most recent call last):
  File "/Users/tiberio/Documents/Cesar School (Mac)/TCC/generative_agents/reverie/backend_server/reverie.py", line 468, in open_server
    rs.start_server(int_count)
  File "/Users/tiberio/Documents/Cesar School (Mac)/TCC/generative_agents/reverie/backend_server/reverie.py", line 401, in start_server
    with open(curr_move_file, "w") as outfile:
FileNotFoundError: [Errno 2] No such file or directory: '../../environment/frontend_server/storage/run1/movement/0.json'
Error.
Enter option: fin

Were you able to make it work? I can provide some screenshots of the problems if you want.

@AurganicSubstance
Copy link
Author

I actually get the same error. I stopped working on it since authors seemed to have abandonned the project. And that s never a good sign for debugging

@justtiberio
Copy link

That's a pity, I wanted to do some testing with this project. But were you able to make the web server work? Like I said when I open the local website it looks static and while the terminal looks like things are happening in the web browser everything is stopped. Have you been able to run it with the website working? Where the characters move and you can see the interactions and all?

@alextveit
Copy link

Same. I particularly wanted to run simulations as a test to see if this could be used to simulate social systems. If anyone has an idea of if others have built similar models, but that currently work, I would greatly appreciate it.

@AurganicSubstance
Copy link
Author

Same. I particularly wanted to run simulations as a test to see if this could be used to simulate social systems. If anyone has an idea of if others have built similar models, but that currently work, I would greatly appreciate it.

Interesting, i m looking for the same topic. I will try out a few similar projects in the near future maybe u can keep an eye on my repositories for reference

@AurganicSubstance
Copy link
Author

Same. I particularly wanted to run simulations as a test to see if this could be used to simulate social systems. If anyone has an idea of if others have built similar models, but that currently work, I would greatly appreciate it.

you can also check out my free Medium blog Shichengqi's Digest

@alextveit
Copy link

Same. I particularly wanted to run simulations as a test to see if this could be used to simulate social systems. If anyone has an idea of if others have built similar models, but that currently work, I would greatly appreciate it.

Interesting, i m looking for the same topic. I will try out a few similar projects in the near future maybe u can keep an eye on my repositories for reference

Will definitely do that. Keenly interested :)

@QuentinADM
Copy link

QuentinADM commented Feb 23, 2024

have you add this code in reverie.py ligne 400

curr_move_path = f"{sim_folder}/movement"
if not os.path.exists(curr_move_path):
os.makedirs(curr_move_path)
curr_move_file = f"{sim_folder}/movement/{self.step}.json"
with open(curr_move_file, "w") as outfile:
outfile.write(json.dumps(movements, indent=2))

@AurganicSubstance
Copy link
Author

have you add this code in reverie.py ligne 400

curr_move_path = f"{sim_folder}/movement" if not os.path.exists(curr_move_path): os.makedirs(curr_move_path) curr_move_file = f"{sim_folder}/movement/{self.step}.json" with open(curr_move_file, "w") as outfile: outfile.write(json.dumps(movements, indent=2))

you can check my pull request's details

@QuentinADM
Copy link

My reply is solution for this error on comment

Traceback (most recent call last): File "/Users/tiberio/Documents/Cesar School (Mac)/TCC/generative_agents/reverie/backend_server/reverie.py", line 468, in open_server rs.start_server(int_count) File "/Users/tiberio/Documents/Cesar School (Mac)/TCC/generative_agents/reverie/backend_server/reverie.py", line 401, in start_server with open(curr_move_file, "w") as outfile: FileNotFoundError: [Errno 2] No such file or directory: '../../environment/frontend_server/storage/run1/movement/0.json' Error. Enter option: fin

I think ...

@gontxomde gontxomde mentioned this pull request Mar 10, 2024
Copy link

@CameronCMaples CameronCMaples left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this. Token issues are still arising even after these changes. Would love another look from you. -4/18/24

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

Successfully merging this pull request may close these issues.

5 participants