ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

[BUG] Maxium recursion depth reached

Open Cheesy-Brik opened this issue 2 years ago • 4 comments

Description Getting this error when trying to ask() in browserless version.

  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\Official.py", line 108, in ask
    self.prompt.construct_prompt(user_request),
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\Official.py", line 242, in construct_prompt
    prompt = self.construct_prompt(new_prompt)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\Official.py", line 242, in construct_prompt
    prompt = self.construct_prompt(new_prompt)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\Official.py", line 242, in construct_prompt
    prompt = self.construct_prompt(new_prompt)
  [Previous line repeated 975 more times]
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\Official.py", line 237, in construct_prompt
    if len(ENCODER.encode(prompt)) > max_tokens:
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\tiktoken\core.py", line 96, in encode
    if match := _special_token_regex(disallowed_special).search(text):
RecursionError: maximum recursion depth exceeded in comparison

Cheesy-Brik avatar Feb 04 '23 03:02 Cheesy-Brik

I think I have the buffer too high

Cheesy-Brik avatar Feb 04 '23 03:02 Cheesy-Brik

Yeh setting my buffer to a lower number has fixed the issue

Cheesy-Brik avatar Feb 04 '23 03:02 Cheesy-Brik

Maximum buffer is 4000 iirc

acheong08 avatar Feb 04 '23 05:02 acheong08

One lower than that actually, as I had my buffer at 4000 (testing)

Cheesy-Brik avatar Feb 05 '23 03:02 Cheesy-Brik