Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,6 @@ import config
|
|
2 |
import openai
|
3 |
|
4 |
openai.api_key = config.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",
|
@@ -12,4 +11,6 @@ openai.api_key = config.api_key
|
|
12 |
frequency_penalty=0.0,
|
13 |
presence_penalty=0.0,
|
14 |
stop=["###"]
|
15 |
-
)
|
|
|
|
|
|
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",
|
|
|
11 |
frequency_penalty=0.0,
|
12 |
presence_penalty=0.0,
|
13 |
stop=["###"]
|
14 |
+
)
|
15 |
+
|
16 |
+
return response.choices(0).text
|