Spaces:
Sleeping
Sleeping
import os | |
import openai | |
secret_value_0 = os.environ.get("openai") | |
openai.api_key = secret_value_0 | |
model_engine = "text-davinci-002" | |
prompt_template = "Say hello world" #prompt_template | |
response = openai.Completion.create( | |
engine=model_engine, | |
prompt=prompt_template, | |
max_tokens=124, | |
temperature=0.8, | |
n=1, | |
stop=None, | |
) | |
print(response.choices[0].text) |