2023-05-22 19:56:49 +00:00
|
|
|
|
using Gpt4All.Bindings;
|
|
|
|
|
|
2023-06-01 20:01:27 +00:00
|
|
|
|
namespace Gpt4All;
|
2023-05-22 19:56:49 +00:00
|
|
|
|
|
|
|
|
|
public static class PredictRequestOptionsExtensions
|
|
|
|
|
{
|
|
|
|
|
public static LLModelPromptContext ToPromptContext(this PredictRequestOptions opts)
|
|
|
|
|
{
|
|
|
|
|
return new LLModelPromptContext
|
|
|
|
|
{
|
|
|
|
|
LogitsSize = opts.LogitsSize,
|
|
|
|
|
TokensSize = opts.TokensSize,
|
|
|
|
|
TopK = opts.TopK,
|
|
|
|
|
TopP = opts.TopP,
|
|
|
|
|
PastNum = opts.PastConversationTokensNum,
|
|
|
|
|
RepeatPenalty = opts.RepeatPenalty,
|
|
|
|
|
Temperature = opts.Temperature,
|
|
|
|
|
RepeatLastN = opts.RepeatLastN,
|
|
|
|
|
Batches = opts.Batches,
|
|
|
|
|
ContextErase = opts.ContextErase,
|
|
|
|
|
ContextSize = opts.ContextSize,
|
|
|
|
|
TokensToPredict = opts.TokensToPredict
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|