|
https://openai.com/blog/chatgpt
https://dev.to/codemee/yong-pyth ... tian-ji-qi-ren-2fh6
重新安裝Anaconda Distribution
pip install openai --upgrade
import openai
openai.api_key = "sk-...."
for i in range(5):
prompt_input = input("Please enter your prompt: ")
response = openai.Completion.create(
model="text-davinci-003",
prompt=prompt_input,
temperature=0.7,
max_tokens=64,
top_p=1.0,
frequency_penalty=0.0,
presence_penalty=0.0
)
print(response['choices'][0]['text'])
https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers
import openai
openai.api_key = "sk-xxxxxxx....7j"
for i in range(3):
prompt_input = input("Please enter your prompt: ")
response = openai.Completion.create(
model="text-davinci-003",
prompt="Translate this into 1.Russian 2.Japanese 3.Yue Chinese:\n\n"+prompt_input,
temperature=0.3,
max_tokens=100,
top_p=1.0,
frequency_penalty=0.0,
presence_penalty=0.0
)
print(response['choices'][0]['text'])
|
本帖子中包含更多資源
您需要 登錄 才可以下載或查看,沒有帳號?立即註冊
x
|