Spaces:
Runtime error
Runtime error
revise start sequence format.
Browse files
app.py
CHANGED
@@ -7,12 +7,12 @@ openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
7 |
|
8 |
#if you have OpenAI API key as a string, enable the below
|
9 |
# openai.api_key = ""
|
10 |
-
print("key", openai.api_key)
|
11 |
|
12 |
-
start_sequence = "\
|
13 |
restart_sequence = "\nMe: "
|
14 |
|
15 |
-
prompt = "Start by typing example content. Then use `Me:` or `
|
16 |
|
17 |
def openai_create(prompt):
|
18 |
|
@@ -24,7 +24,7 @@ def openai_create(prompt):
|
|
24 |
top_p=1,
|
25 |
frequency_penalty=0,
|
26 |
presence_penalty=0.6,
|
27 |
-
stop=[" Me:", "
|
28 |
)
|
29 |
return response.choices[0].text
|
30 |
|
|
|
7 |
|
8 |
#if you have OpenAI API key as a string, enable the below
|
9 |
# openai.api_key = ""
|
10 |
+
# print("key", openai.api_key)
|
11 |
|
12 |
+
start_sequence = "\nAI:"
|
13 |
restart_sequence = "\nMe: "
|
14 |
|
15 |
+
prompt = "Start by typing example content. Then use `Me:` or `AI:` with some clue to train model...\n\nMe: Hello, who are you?\nAI: I am AI created by OpenAI. How can I help you today?\nMe: "
|
16 |
|
17 |
def openai_create(prompt):
|
18 |
|
|
|
24 |
top_p=1,
|
25 |
frequency_penalty=0,
|
26 |
presence_penalty=0.6,
|
27 |
+
stop=[" Me:", " AI:"]
|
28 |
)
|
29 |
return response.choices[0].text
|
30 |
|