Spaces:
Build error
Build error
Download app.py from pvanand/RASA_OpenAI_actions_server: direct link, hf CLI and curl.
- Browser
- Download file 378 Bytes
-
https://huggingface.co/spaces/pvanand/RASA_OpenAI_actions_server/resolve/main/app.py
- Command line
-
hf download hf://spaces/pvanand/RASA_OpenAI_actions_server/app.py
-
curl -L -o app.py https://huggingface.co/spaces/pvanand/RASA_OpenAI_actions_server/resolve/main/app.py
378 Bytes
| 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) |