Spaces:
Runtime error
Runtime error
Commit
•
2cbf810
1
Parent(s):
a9f69d4
update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import os
|
2 |
#pip3 install openai
|
3 |
-
import openai
|
4 |
#pip3 install gradio
|
5 |
import gradio as gr
|
6 |
|
@@ -11,7 +11,7 @@ openai.api_key = os.getenv("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"
|
|
11 |
#if you have OpenAI API key as a string, enable the below
|
12 |
OPEN_AI_KEY = OPENAI_API_KEY
|
13 |
|
14 |
-
|
15 |
|
16 |
start_sequence = "\nAI:"
|
17 |
restart_sequence = "\nHuman: "
|
@@ -20,7 +20,7 @@ prompt = "Feel free to ask any question to this bot, it can find you many soluti
|
|
20 |
|
21 |
def openai_create(prompt):
|
22 |
|
23 |
-
response =
|
24 |
model="text-davinci-003",
|
25 |
prompt=prompt,
|
26 |
temperature=0.9,
|
|
|
1 |
import os
|
2 |
#pip3 install openai
|
3 |
+
import openai
|
4 |
#pip3 install gradio
|
5 |
import gradio as gr
|
6 |
|
|
|
11 |
#if you have OpenAI API key as a string, enable the below
|
12 |
OPEN_AI_KEY = OPENAI_API_KEY
|
13 |
|
14 |
+
openai.api_key = OPEN_AI_KEY
|
15 |
|
16 |
start_sequence = "\nAI:"
|
17 |
restart_sequence = "\nHuman: "
|
|
|
20 |
|
21 |
def openai_create(prompt):
|
22 |
|
23 |
+
response = openai.Completion.create(
|
24 |
model="text-davinci-003",
|
25 |
prompt=prompt,
|
26 |
temperature=0.9,
|