Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,14 @@
|
|
1 |
-
import
|
2 |
import openai
|
3 |
|
4 |
-
openai.api_key =
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
)
|
|
|
1 |
+
import config
|
2 |
import openai
|
3 |
|
4 |
+
openai.api_key = config.api_key
|
5 |
+
response = openai.Completion.create(
|
6 |
+
model="code-davinci-002",
|
7 |
+
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",
|
8 |
+
temperature=0,
|
9 |
+
max_tokens=182,
|
10 |
+
top_p=1.0,
|
11 |
+
frequency_penalty=0.0,
|
12 |
+
presence_penalty=0.0,
|
13 |
+
stop=["###"]
|
14 |
+
)
|
|