Spaces:
Sleeping
Sleeping
Commit
·
bb0e5ad
1
Parent(s):
4ccc736
app: simplify the sytem prompt
Browse filesSigned-off-by: panchajanya <rsk52959@gmail.com>
app.py
CHANGED
|
@@ -22,6 +22,7 @@ system = ("Act like you are a chatbot. Be precise and unique with your answers."
|
|
| 22 |
# setup a function that accepts propmpt and returns a response using "gpt-3.5-turbo" model
|
| 23 |
|
| 24 |
def chatbot(prompt, temperature = 0.2, developer_mode = False):
|
|
|
|
| 25 |
response = opai.ChatCompletion.create(
|
| 26 |
model = "gpt-3.5-turbo",
|
| 27 |
max_tokens = 1024,
|
|
@@ -29,7 +30,7 @@ def chatbot(prompt, temperature = 0.2, developer_mode = False):
|
|
| 29 |
frequency_penalty = 0,
|
| 30 |
presence_penalty = 0.6,
|
| 31 |
messages = [
|
| 32 |
-
{"role": "system", "content":
|
| 33 |
{"role": "user", "content": prompt}
|
| 34 |
]
|
| 35 |
)
|
|
|
|
| 22 |
# setup a function that accepts propmpt and returns a response using "gpt-3.5-turbo" model
|
| 23 |
|
| 24 |
def chatbot(prompt, temperature = 0.2, developer_mode = False):
|
| 25 |
+
system_message = developer_msg if developer_mode else system
|
| 26 |
response = opai.ChatCompletion.create(
|
| 27 |
model = "gpt-3.5-turbo",
|
| 28 |
max_tokens = 1024,
|
|
|
|
| 30 |
frequency_penalty = 0,
|
| 31 |
presence_penalty = 0.6,
|
| 32 |
messages = [
|
| 33 |
+
{"role": "system", "content": system_message},
|
| 34 |
{"role": "user", "content": prompt}
|
| 35 |
]
|
| 36 |
)
|