MaziyarPanahi
commited on
Commit
•
e75173f
1
Parent(s):
fcf56ed
Fix system prompt
Browse files
app.py
CHANGED
@@ -20,6 +20,13 @@ headers = {
|
|
20 |
"Authorization": f"Bearer {API_KEY}",
|
21 |
}
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
def is_valid_json(data):
|
25 |
try:
|
@@ -97,7 +104,7 @@ with gr.Blocks() as demo:
|
|
97 |
# user_question = history[-1][0]
|
98 |
history[-1][1] = ""
|
99 |
|
100 |
-
history_messages =
|
101 |
print(history_messages)
|
102 |
|
103 |
data = {
|
|
|
20 |
"Authorization": f"Bearer {API_KEY}",
|
21 |
}
|
22 |
|
23 |
+
sys_msg = [
|
24 |
+
{
|
25 |
+
"content": "You are a helpful assistant. Be respectful, professional, and try to be helpful. If you don't know something, just say \"I don't know\"",
|
26 |
+
"role": "system",
|
27 |
+
}
|
28 |
+
]
|
29 |
+
|
30 |
|
31 |
def is_valid_json(data):
|
32 |
try:
|
|
|
104 |
# user_question = history[-1][0]
|
105 |
history[-1][1] = ""
|
106 |
|
107 |
+
history_messages = sys_msg + history_messages
|
108 |
print(history_messages)
|
109 |
|
110 |
data = {
|