首页 > 其他分享 >OpenAI API 参数说明

OpenAI API 参数说明

时间:2023-02-23 21:12:20浏览次数:32  
标签:temperature top number tokens API 参数 OpenAI 2.0 Optional

OpenAI API
https://platform.openai.com/docs/api-reference/completions/create#completions/create-model

 

 

max_tokens
integer
Optional
Defaults to 16
The maximum number of tokens to generate in the completion.

The token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).

最大令牌数
整数
选修的
默认为16
完成时生成的最大令牌数。

您的提示加上的令牌计数max_tokens不能超过模型的上下文长度。大多数模型的上下文长度为 2048 个标记(最新模型除外,它支持 4096)。

temperature
number
Optional
Defaults to 1
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

We generally recommend altering this or top_p but not both.
温度
数字
选修的
默认为1
使用什么采样温度,介于 0 和 2 之间。较高的值(如 0.8)将使输出更加随机,而较低的值(如 0.2)将使输出更加集中和确定。
我们通常建议改变这个或temperature但不是两者。



top_p
number
Optional
Defaults to 1
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this or temperature but not both.

top_p
数字
选修的
默认为1
一种替代温度采样的方法,称为核采样,其中模型考虑具有 top_p 概率质量的标记的结果。所以 0.1 意味着只考虑构成前 10% 概率质量的标记。


我们通常建议改变这个或top_p但不是两者。

presence_penalty
number
Optional
Defaults to 0
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

See more information about frequency and presence penalties.
存在_惩罚
数字
选修的
默认为0
-2.0 和 2.0 之间的数字。正值会根据到目前为止是否出现在文本中来惩罚新标记,从而增加模型谈论新主题的可能性。

查看有关频率和存在惩罚的更多信息。


frequency_penalty
number
Optional
Defaults to 0
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

See more information about frequency and presence penalties.
频率惩罚
数字
选修的
默认为0
-2.0 和 2.0 之间的数字。正值会根据新标记在文本中的现有频率对其进行惩罚,从而降低模型逐字重复同一行的可能性。

查看有关频率和存在惩罚的更多信息。

 

标签:temperature,top,number,tokens,API,参数,OpenAI,2.0,Optional
From: https://www.cnblogs.com/rogge7/p/17149418.html

相关文章

  • RESETful API接口设计规范
    开发工作中,我们有时需要提供API接口给客户端或者第三方使用,那么如何构建一个能让使用者快速理解的API是一项重要的工作。如何我们在设计API时就严格遵守一些规范,那么在后面......
  • Centos下KONG API网关实践
    上篇已经安装好了kong​​Centos安装KONG​​一、命令操作kong网关-添加服务和路由services:创建名为service.api的服务,并通过host绑定相应的后端服务upstream.api。cur......
  • C++主函数参数
    学习C++主函数的参数输入,用于从commandline中读取参数,下面以读取视频文件为例进行说明#include<iostream>#include<fstream>#include<string>#include<opencv2/op......
  • 数据服务api加密方式
    md5+签名认证packagecom.alibaba.dt.dataphin;importorg.apache.commons.codec.binary.Base64;importorg.apache.http.Header;importorg.apache.http.HttpRespo......
  • asp.net core webapi之创建项目后切换http/https
    在项目调试过程中如果选择了https则会出现下面问题这时的解决方案为:项目-右键-属性-调试,把原先的https后的s删除即可  ......
  • asp.net core webapi初识
    1.建立webapi项目  2.把启用SSL取消勾选(取消https)  3.选择项目-右键-发布,进行发布信息设置,选择文件夹发布   4.打开IIS管理器,新建网站,物理路径选择刚刚......
  • A Tandem Learning Rule for Effective Training and Rapid Inference of Deep Spikin
    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布!IEEETRANSACTIONSONNEURALNETWORKSANDLEARNINGSYSTEMS,VOL.34,NO.1,JANUARY2023 Abstract脉......
  • ASEMI高压MOS管60R380参数,60R380特征,60R380应用
    编辑-ZASEMI高压MOS管60R380参数:型号:60R380漏极-源极电压(VDS):600V栅源电压(VGS):20V漏极电流(ID):11A功耗(PD):65W储存温度(Tstg):-55to150℃静态漏源导通电阻(RDS(ON)):0.38Ω......
  • ASEMI高压MOS管60R380参数,60R380特征,60R380应用
    编辑-ZASEMI高压MOS管60R380参数:型号:60R380漏极-源极电压(VDS):600V栅源电压(VGS):20V漏极电流(ID):11A功耗(PD):65W储存温度(Tstg):-55to150℃静态漏源导通电阻(RDS(ON)):0.38Ω二极管正向......
  • ABAP 委外采购收货调用过账bapi
    相关的表:ekko:采购凭证抬头表用于判断是否委外ekpo:采购凭证行项目表用于判断是否委外以及委外采购的数量resb:获取委外采购单中bom的相应预留mseg:获取已经委外原材......