Download api.py from nlsefouh/Silk_LLM: direct link, hf CLI and curl.
- Browser
- Download file 398 Bytes
-
https://huggingface.co/nlsefouh/Silk_LLM/resolve/main/api.py
- Command line
-
hf download hf://nlsefouh/Silk_LLM/api.py
-
curl -L -o api.py https://huggingface.co/nlsefouh/Silk_LLM/resolve/main/api.py
398 Bytes
| import os | |
| import openai | |
| openai.api_key = os.getenv("OPENAI_API_KEY") | |
| response = openai.Completion.create( | |
| model="text-davinci-003", | |
| prompt="#JavaScript to Python:\nJavaScript: \ndogs = [\"bill\", \"joe\", \"carl\"]\ncar = []\ndogs.forEach((dog) {\n car.push(dog);\n});\n\nPython:", | |
| temperature=0, | |
| max_tokens=64, | |
| top_p=1.0, | |
| frequency_penalty=0.0, | |
| presence_penalty=0.0 | |
| ) |