Giter Club home page Giter Club logo

Comments (5)

gehrisandro avatar gehrisandro commented on May 23, 2024 1

@ManukMinasyan Thank you for clarification.

Now I know, why I wasn't able to reproduce the bug: It has already been fixed in Release 0.2.0
Please make sure, that you are using the latest version of the package.

from client.

gehrisandro avatar gehrisandro commented on May 23, 2024

Hi @ManukMinasyan

I was not able to reproduce the issue.
Additionally the API specification says, that "completion_tokens" is not nullable. See: https://github.com/openai/openai-openapi/blob/master/openapi.yaml#L2080

Can you provide more details about the parameters you sent?

from client.

ManukMinasyan avatar ManukMinasyan commented on May 23, 2024

@gehrisandro I'm getting that error with this prompt:

$parameters['prompt'] = '""
Instruction: <<Answer to the Quora question>>
Question: <<abc>>
Information: <<>>
Result Structure <<answer>>
""';

from client.

ManukMinasyan avatar ManukMinasyan commented on May 23, 2024

After many time of searches, I have found the problem. It turns out that OpenAI will not return completion_tokens.

Request:

curl --location --request POST 'https://api.openai.com/v1/completions' \
--header 'Authorization: Bearer XXXXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "text-davinci-002",
    "prompt": "Instruction: <<Create an article idea title and outline for an essay about the following keyword>> Keyword:<<sasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdv>>Structure: <<Title:Outline:>>",
    "max_tokens": 100,
    "temperature": 0.7
}'

Response

{
    "id": "cmpl-6BQocmU7pbkVMGcRFXaGcgtnLJ259",
    "object": "text_completion",
    "created": 1668182706,
    "model": "text-davinci-002",
    "choices": [
        {
            "text": "",
            "index": 0,
            "logprobs": null,
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 116,
        "total_tokens": 116
    }
}

image

from client.

ManukMinasyan avatar ManukMinasyan commented on May 23, 2024

I think it is necessary to set completion tokens to zero in this situation.

from client.

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.