Chat completions /v1/chat/completions 结果与 ChatGPT 结果差异很大

我发现 API /v1/chat/completions 的结果与网页上的结果差异很大。

这是 API 对问题“What is the birthday of George Washington”的响应:

    curl --location 'https://api.openai.com/v1/chat/completions' \    --header 'Authorization: Bearer TOKEN' \    --header 'Content-Type: application/json' \    --data '{        "model": "gpt-4",        "messages": [            {                "role": "user",                "content": "What is the birthday of George Washington"            }        ]    }'
    "choices": [            {                "message": {                    "role": "assistant",                    "content": "George Washington was born on February 22, 1732."                },                "finish_reason": "stop",                "index": 0            }        ]

这是网页上的结果。你可以看到它要长得多。enter image description here


回答:

遗憾的是,ChatGPT-4 也不愿意透露更多信息。虽然可以通过 API 调整温度参数找到一个好的平衡点,但我也很想知道网页版的默认温度到底是多少。

通过网页向 ChatGPT-4 提问:使用网页版 ChatGPT 时的默认温度是多少?

ChatGPT-4 的回答:使用网页界面时,ChatGPT 的默认温度可能不会明确说明。然而,使用 OpenAI 的 API 时,默认温度通常设置为 0.7。这个值在创造性和连贯性之间提供了一个很好的平衡。你可以调整温度来控制生成文本的随机性:较低的温度(例如 0.2)使输出更加集中和确定性,而较高的温度(例如 1.0)使其更加随机和富有创造性。请记住,网页界面和 API 可能有不同的默认值或行为。

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注