Git Product home page Git Product logo

Comments (9)

sdugoten avatar sdugoten commented on May 14, 2024 1

I tried some googling and changed the model to:

modelName: 'gpt-3.5-turbo'

and now it seems to work. @sdugoten - can you try to change the modelName and see if it works for you?

Reference to the docs for a list of supported modelNames

ok, it does seems to be the model name, you have to use "gpt-3.5-turbo" instead of "gpt-3.5". I am gonna try my own pdf and see if that works.

from gpt4-pdf-chatbot-langchain.

ankri avatar ankri commented on May 14, 2024 1

For future readers: Yes. You are running into problems with text-davinci-003 because the OpenAI wrapper is hitting the https://api.openai.com/v1/chat/completions endpoint.

These are the supported models for this endpoint:
image
gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301

Source

from gpt4-pdf-chatbot-langchain.

mayooear avatar mayooear commented on May 14, 2024

Can you provide more information on the source code behind this error? It appears to be an issue with your API keys.

from gpt4-pdf-chatbot-langchain.

sdugoten avatar sdugoten commented on May 14, 2024

Can you provide more information on the source code behind this error? It appears to be an issue with your API keys.

where can I give you more information so that I can help you to troubleshoot? I just follow the instruction from your main page https://github.com/mayooear/gpt4-pdf-chatbot-langchain and run the program.

I basically generate the openAI key in user setting page, and paste it inside .env

The entry looks something like this

OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxohrzgxxxxx6BM

from gpt4-pdf-chatbot-langchain.

ankri avatar ankri commented on May 14, 2024

Hey. Thanks for the repo and the work you put in! I have the same error.

  const docChain = loadQAChain(
    new OpenAIChat({
      temperature: 0,
      modelName: 'text-davinci-003', // <--
      streaming: Boolean(onTokenStream),
      callbackManager: onTokenStream
        ? CallbackManager.fromHandlers({
            async handleLLMNewToken(token) {
              onTokenStream(token);
              console.log(token);
            },
          })
        : undefined,
    }),
    { prompt: QA_PROMPT },
  );

This is the only part I changed in the code.


This is the output I get from running curl https://api.openai.com/v1/models -H "Authorization: Bearer XXX"

// ...
    {
      "id": "text-davinci-003",
      "object": "model",
      "created": 1669599635,
      "owned_by": "openai-internal",
      "permission": [
        {
          "id": "modelperm",
          "object": "model_permission",
          "created": 1678585020,
          "allow_create_engine": false,
          "allow_sampling": true,
          "allow_logprobs": true,
          "allow_search_indices": false,
          "allow_view": true,
          "allow_fine_tuning": false,
          "organization": "*",
          "group": null,
          "is_blocking": false
        }
      ],
      "root": "text-davinci-003",
      "parent": null
    },
// ...

These are my pinecone settings. I am not familiar with pinecone, so I copied (or thought that I copied) your values:
image

from gpt4-pdf-chatbot-langchain.

sdugoten avatar sdugoten commented on May 14, 2024

You can see the error in action here

https://www.youtube.com/watch?v=s82PalNVJiM

from gpt4-pdf-chatbot-langchain.

ankri avatar ankri commented on May 14, 2024

I tried some googling and changed the model to:

modelName: 'gpt-3.5-turbo'

and now it seems to work. @sdugoten - can you try to change the modelName and see if it works for you?

Reference to the docs for a list of supported modelNames

from gpt4-pdf-chatbot-langchain.

mayooear avatar mayooear commented on May 14, 2024

@ankri great find here! Appreciate it. Are you running into errors with text-davinci-003 ?

from gpt4-pdf-chatbot-langchain.

mayooear avatar mayooear commented on May 14, 2024

For future readers: Yes. You are running into problems with text-davinci-003 because the OpenAI wrapper is hitting the https://api.openai.com/v1/chat/completions endpoint.

These are the supported models for this endpoint: image gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301

Source

Good catch!

from gpt4-pdf-chatbot-langchain.

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.