Spaces:
Runtime error
Runtime error
Create new file
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import openai
|
3 |
+
|
4 |
+
openai.api_key = os.getenv("OPENAI_API_KEY")
|
5 |
+
|
6 |
+
response = openai.Completion.create(
|
7 |
+
model="code-davinci-002",
|
8 |
+
prompt="##### Fix bugs in the below function\n \n### Buggy Python\nimport Random\na = random.randint(1,12)\nb = random.randint(1,12)\nfor i in range(10):\n question = \"What is \"+a+\" x \"+b+\"? \"\n answer = input(question)\n if answer = a*b\n print (Well done!)\n else:\n print(\"No.\")\n \n### Fixed Python",
|
9 |
+
temperature=0,
|
10 |
+
max_tokens=182,
|
11 |
+
top_p=1.0,
|
12 |
+
frequency_penalty=0.0,
|
13 |
+
presence_penalty=0.0,
|
14 |
+
stop=["###"]
|
15 |
+
)
|