Giter Site home page Giter Site logo

Comments (4)

Alexei000 avatar Alexei000 commented on May 8, 2024

@isaacwalkercox I have tried to reproduce your error and it seems to work for various cases (example):

	var completionRequest = new CompletionRequest
	{
		Prompt = "one two three",
		MaxTokens = 5,
		Temperature = 0,
		TopP = 1,
		PresencePenalty = 0,
		FrequencyPenalty = 0,
		Logprobs = 10,
		StopSequence = "###"
	};

	var result = await api.Completions.CreateCompletionAsync(completionRequest);

Indeed token_logprobs maps to an IList<double> which cannot accept null values, but I cannot figure out a case when the OpenAI returns a null prob value.

Can you provide the code that did not work for you?

from openai-api-dotnet.

Alexei000 avatar Alexei000 commented on May 8, 2024

I have managed to reproduce this by mistake with the following code:


private OpenAIAPI GetApi => new OpenAIAPI(engine: Engine.Ada);
var api = GetApi;

var completionReq = new CompletionRequest
{
   Prompt = "three four five",
   Temperature = 0,
   MaxTokens = 5,
   Echo = true,
   StopSequence = "eight"
};

var results = await api.Completions.CreateCompletionsAsync(completionReq);

By replacing List<double> should be replaced with List<double?>, it works as expected. If this solution is acceptable, I will create a PR with this minor fix.

Note: After a while, it no longer reproduces. It might be some throttling or similar that makes OpenAI not return those values sometimes.

from openai-api-dotnet.

gotmike avatar gotmike commented on May 8, 2024

i know this is old, i'm trying to check on some of these...

i ran your test code and seems to execute without error.

is this still an issue?

from openai-api-dotnet.

isaacwalkercox avatar isaacwalkercox commented on May 8, 2024

@gotmike Yes. This issue was resolved. Thank you for double checking.

from openai-api-dotnet.

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.