Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

免费api key中的 gpt-4o-mini 模型 temperature 参数失效 #295

Open
jasonwujch opened this issue Sep 18, 2024 · 1 comment
Open

免费api key中的 gpt-4o-mini 模型 temperature 参数失效 #295

jasonwujch opened this issue Sep 18, 2024 · 1 comment

Comments

@jasonwujch
Copy link

Describe the bug 描述bug
免费api key中的 gpt-4o-mini 模型 temperature 参数失效

To Reproduce 复现方法
Steps to reproduce the behavior:

from openai import OpenAI

client = OpenAI(
# fill in your own API key here
api_key= ...,
base_url="https://api.chatanywhere.org/v1"
)

def get_completion(prompt, model="gpt-4o-mini", temperature=0):
messages = [{"role": "user", "content": prompt}]
response = client.chat.completions.create(
model=model,
messages=messages,
temperature=temperature, # this is the degree of randomness of the model's output
)
return response.choices[0].message.content

get_completion("tell me a joke", temperature = 1, model="gpt-4o-mini")

Screenshots 截图
每次都返回同样的结果,gpt-3.5-turbo 会返回不同结果

@ynpl
Copy link

ynpl commented Sep 20, 2024

你还要设置及其他的参数 光设置temperature 没有用的 建议查看Openai 官方文档

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants