Update app.py
Browse files
app.py
CHANGED
|
@@ -186,15 +186,6 @@ def get_default_system_prompt(personalized_data):
|
|
| 186 |
"""
|
| 187 |
print(DEFAULT_SYSTEM_PROMPT)
|
| 188 |
return DEFAULT_SYSTEM_PROMPT
|
| 189 |
-
|
| 190 |
-
## trust-game-llama-2-7b-chat
|
| 191 |
-
# app.py
|
| 192 |
-
def construct_input_prompt(chat_history, message):
|
| 193 |
-
input_prompt = f"<s>[INST] <<SYS>>\n{get_default_system_prompt(personalized_data)}\n<</SYS>>\n\n "
|
| 194 |
-
for user, assistant in chat_history:
|
| 195 |
-
input_prompt += f"{user} [/INST] {assistant} <s>[INST] "
|
| 196 |
-
input_prompt += f"{message} [/INST] "
|
| 197 |
-
return input_prompt
|
| 198 |
|
| 199 |
@spaces.GPU
|
| 200 |
def generate(
|
|
@@ -228,6 +219,15 @@ def generate(
|
|
| 228 |
personalized_data = fetch_personalized_data(session_index)
|
| 229 |
DEFAULT_SYSTEM_PROMPT = get_default_system_prompt(personalized_data)
|
| 230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
# Construct the input prompt using the functions from the construct_input_prompt function
|
| 232 |
input_prompt = construct_input_prompt(chat_history, message)
|
| 233 |
|
|
|
|
| 186 |
"""
|
| 187 |
print(DEFAULT_SYSTEM_PROMPT)
|
| 188 |
return DEFAULT_SYSTEM_PROMPT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
|
| 190 |
@spaces.GPU
|
| 191 |
def generate(
|
|
|
|
| 219 |
personalized_data = fetch_personalized_data(session_index)
|
| 220 |
DEFAULT_SYSTEM_PROMPT = get_default_system_prompt(personalized_data)
|
| 221 |
|
| 222 |
+
## trust-game-llama-2-7b-chat
|
| 223 |
+
# app.py
|
| 224 |
+
def construct_input_prompt(chat_history, message):
|
| 225 |
+
input_prompt = f"<s>[INST] <<SYS>>\n{DEFAULT_SYSTEM_PROMPT}\n<</SYS>>\n\n "
|
| 226 |
+
for user, assistant in chat_history:
|
| 227 |
+
input_prompt += f"{user} [/INST] {assistant} <s>[INST] "
|
| 228 |
+
input_prompt += f"{message} [/INST] "
|
| 229 |
+
return input_prompt
|
| 230 |
+
|
| 231 |
# Construct the input prompt using the functions from the construct_input_prompt function
|
| 232 |
input_prompt = construct_input_prompt(chat_history, message)
|
| 233 |
|