xtekky / chatgpt-clone

ChatGPT interface with better UI
https://g4f.ai
GNU General Public License v3.0
3.44k stars 1.03k forks source link

list index out of range None #46

Open Raccoon254 opened 1 year ago

Raccoon254 commented 1 year ago

The Error in the CLI is ....

image

The opened Port Results are....

image

Platform Windows

amihos commented 1 year ago

same

Raccoon254 commented 1 year ago

Trying to fix it

revbin commented 1 year ago

you didn't add your OpenAI API to config.json

ZexiChen502 commented 1 year ago

您没有将 OpenAI API 添加到 config.json

how

pz1971 commented 1 year ago

Facing the same issue. (I've added my OpenAI API key).

ZexiChen502 commented 1 year ago

you didn't add your OpenAI API to config.json

I've added my OpenAI API key too(form the "platform.openai.com/account/api-keys:+Create new secret key" to "the local/chatgpt-clone-main/config.json: openai_key:" ) . I still encounter this bug, and I'm not sure if it's necessary to add an api, because it's not in the author's tutorial

revbin commented 1 year ago

Hi

you must use your own OpenAI API key , be sure also to use the correct OpenAi Model.

if you dont have access to GPT-4 so select GPT-3.5 model and it work .

i got the same error when i installed the script without API key and used the GPT-4 Model which i dont have access yet .

so the solution which worked for me .: -Add your API Key to config.json -clear your web browser cache -restart the server -choose the right OpenAI model you have access to.

regards

neildmd commented 1 year ago

I tried all the suggested solutions (verified API key is correct, proxy set to false) and still get no response and console shows this for every request:

127.0.0.1 - - [01/May/2023 20:03:45] "POST /backend-api/v2/conversation HTTP/1.1" 200 - 127.0.0.1 - - [01/May/2023 20:04:50] "GET / HTTP/1.1" 302 - 127.0.0.1 - - [01/May/2023 20:04:50] "GET /chat HTTP/1.1" 308 - 127.0.0.1 - - [01/May/2023 20:04:50] "GET /chat/ HTTP/1.1" 200 - 127.0.0.1 - - [01/May/2023 20:04:50] "GET /assets/js/highlight.min.js HTTP/1.1" 200 - 127.0.0.1 - - [01/May/2023 20:04:50] "GET /assets/js/icons.js HTTP/1.1" 200 - 127.0.0.1 - - [01/May/2023 20:04:50] "GET /assets/js/highlightjs-copy.min.js HTTP/1.1" 200 - 127.0.0.1 - - [01/May/2023 20:04:50] "GET /assets/css/style.css HTTP/1.1" 200 - 127.0.0.1 - - [01/May/2023 20:04:50] "GET /assets/js/chat.js HTTP/1.1" 200 - 127.0.0.1 - - [01/May/2023 20:05:08] "GET /assets/img/site.webmanifest HTTP/1.1" 200 - 127.0.0.1 - - [01/May/2023 20:05:08] "GET /assets/img/favicon-32x32.png HTTP/1.1" 200 - 127.0.0.1 - - [01/May/2023 20:05:50] "GET /assets/img/user.png HTTP/1.1" 200 - 127.0.0.1 - - [01/May/2023 20:05:50] "GET /assets/img/gpt.png HTTP/1.1" 200 - list index out of range None list index out of range None list index out of range None list index out of range None list index out of range None list index out of range None list index out of range None list index out of range None 127.0.0.1 - - [01/May/2023 20:05:52] "POST /backend-api/v2/conversation HTTP/1.1" 200 -

sA1mon commented 1 year ago

I added an additional log to ./server/backend.py after gpt_resp initialization

print(gpt_resp.text)

And I got an error response with the message "You exceeded your current quota, please check your plan and billing details." I suggest that you look at your log in the same way.

Possible solution: Setup your paid plan

Originalimoc commented 1 year ago

UI is giving correct output, but CLI still log this:

"list index out of range
None" * n

Expecting value: line 1 column 2 (char 1)
<traceback object at 0x7feb6f4d6640>
list index out of range
None