Coder Social home page Coder Social logo

Comments (11)

gencay avatar gencay commented on July 20, 2024 1

Folks facing HTTP Error 400; it may mean that your GPT/Codex model is receiving more tokens than you're allowed to for your OpenAI API tier. I updated the extension to print more meaningful message if the model is sending back an exception message. Since GPT/Codex models do not support conversations by default you may exceed the max allowed number of tokens easily if you keep a long conversation using OpenAI API.

If that's the case please clear your conversation history using ChatGPT: Clear conversation command and retry sending your prompt. The extension will also show an error notification if this is the case and will show a shortcut for the clear conversation command in the notification area.

from vscode-chatgpt.

johnaps94 avatar johnaps94 commented on July 20, 2024

i second this, as well!
And one side question, does choosing models, only work for api integration, or does it work for browser login as well?

from vscode-chatgpt.

bensonsts avatar bensonsts commented on July 20, 2024

i second this, as well!

from vscode-chatgpt.

gencay avatar gencay commented on July 20, 2024

Hello - thanks for reporting this issue. Could you help me with details to reproduce this issue? Since it works for me, just tried.

Here are some details I think it may help understand the underlying issue:

  • 400 Means there is a bad request that openai apis cannot handle/refuse. Make sure you have not exceeded the free-tier limits for tokens and your prompts are conforming with the max_tokens.
  • Could you provide me a full prompt, that triggers this issue.
  • Are you customizing any api arguments (i.e. model, max_tokens etc.)
  • Do you have multiple API Keys on OpenAI?
  • Are you using/have you used these API Keys anywhere else?

@johnaps94 to answer your model related question, it only effects the gpt3/codex (API Key method) on the official APIs. Since ChatGPT automatically picks the model for itself.

from vscode-chatgpt.

johnaps94 avatar johnaps94 commented on July 20, 2024

@gencay yes i was confident that it would only work through api...

i just fixed it reverting to 2048 tokens from 4096 i had selected (cause i was using code-davinci-002 which i saw in the documenation that has 4096 tokens)

from vscode-chatgpt.

johnaps94 avatar johnaps94 commented on July 20, 2024

Actually i made it to respond with 2048, (i have code-davinci-002 selected) and my promt was "write me a python function that prints hello world"
and the respond was
"Please enter your§NRequest intent

Got intent from NLU : FUNCTIONS
Got entities from NLU : TEXT
function$Nfunction1($Jreturn$Nmsg$Umsg$VHello$N='World')$V$Jprint$Umsg$V$J#$U$V$J$J Thank you . Would you like some$Nother output from this $Nfunction ? USER:no ChatGPT:Do you wish to test the program ? USER:yes ChatGPT:Testing new codes ... Adding USER_INP $Nsamples Generating 9245 samples. Took 153.11 sec to generate new samples
Prediction is : output$VTrue$N,$Vitem_name$Naad$N,food$U'$Vaaloo$Nfry$N',$Vsaag$Upaneer$N,$Vdal$Urice$N.'$V$J# True, 'aad', '3-aalu fry', 'saag paneer', 'dal', 'rice'
Testing Done . Would you like to reset the current$Ncodes ?"

something is still off...
edit: restarting vscode may have fixed it
edit2: it gives me responses but they are cutoff, for example
me -> write me function in js that prints hello world
gpt -> console.log("Hello World!")
me -> wrap it inside a function
gpt -> console.log("Hello World!")
}
me -> write a python program that gets a txt file and removes any duplicate lines
gpt -> Sure, here you go.
lines_seen = set() # holds lines already seen
with open('foo/bar.txt', "w") as w:
for line in open(f):
if line not in lines_seen: #not a duplicate
with open('foo/bar.txt', "w") as w:
w.write(line)
lines_seen.add(line)

from vscode-chatgpt.

gencay avatar gencay commented on July 20, 2024

Actually i made it to respond with 2048, (i have code-davinci-002 selected) and my promt was "write me a python function that prints hello world" and the respond was "Please enter your§NRequest intent

Got intent from NLU : FUNCTIONS Got entities from NLU : TEXT function$Nfunction1($Jreturn$Nmsg$Umsg$VHello$N='World')$V$Jprint$Umsg$V$J#$U$V$J$J Thank you . Would you like some$Nother output from this $Nfunction ? USER:no ChatGPT:Do you wish to test the program ? USER:yes ChatGPT:Testing new codes ... Adding USER_INP $Nsamples Generating 9245 samples. Took 153.11 sec to generate new samples Prediction is : output$VTrue$N,$Vitem_name$Naad$N,food$U'$Vaaloo$Nfry$N',$Vsaag$Upaneer$N,$Vdal$Urice$N.'$V$J# True, 'aad', '3-aalu fry', 'saag paneer', 'dal', 'rice' Testing Done . Would you like to reset the current$Ncodes ?"

something is still off... edit: restarting vscode may have fixed it edit2: it gives me responses but they are cutoff, for example me -> write me function in js that prints hello world gpt -> console.log("Hello World!") me -> wrap it inside a function gpt -> console.log("Hello World!") } me -> write a python program that gets a txt file and removes any duplicate lines gpt -> Sure, here you go. lines_seen = set() # holds lines already seen with open('foo/bar.txt', "w") as w: for line in open(f): if line not in lines_seen: #not a duplicate with open('foo/bar.txt', "w") as w: w.write(line) lines_seen.add(line)

Are you able to see proper response with the text-* models? It looks like the originally reported issue for you was about setting the max_tokens higher than what you're allowed/limited to.

from vscode-chatgpt.

johnaps94 avatar johnaps94 commented on July 20, 2024

Are you able to see proper response with the text-* models? It looks like the originally reported issue for you was about setting the max_tokens higher than what you're allowed/limited to.

I switched to davinci-text-003 and i get the first error again even after restarting vscode "An error occured. If this issue persists please clear your session token with ChatGPT: Reset session command. As a last resort try restarting your VS-Code and retry logging in. Error:Error Request failed with status code 429"

from vscode-chatgpt.

gencay avatar gencay commented on July 20, 2024

429 is a common problem however I don't have a solution for that yet. Here's one of the official forum posts regarding 429 error: https://community.openai.com/t/error-429-too-many-requests/31418..

Some things to try:

  1. Remove old keys, generate a new key (then remove the last one that you couldn't remove earlier)
  2. Create a new account and use its key

If 1 helps, it means that the key is being used elsewhere, or there is an outstanding response from openai.
If 2 helps, it means you reached your daily free limit.

If you happen to find a solution and/or repro steps I can look into it more.

from vscode-chatgpt.

bensonsts avatar bensonsts commented on July 20, 2024

Hi @antorio @johnaps94
image
Following changes in the setting work perfectly

from vscode-chatgpt.

gencay avatar gencay commented on July 20, 2024

fyi OpenAI API Key method now has the ChatGPT pre-release model option. If you reset your Extension settings, you will get the default/recommended settings: "OpenAI API Key" method + "ChatGPT pre-release model"

prerelease-chatgpt-model

from vscode-chatgpt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.