Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,16 @@ client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
|
5 |
|
6 |
from prompts import GAME_MASTER, COMPRESS_HISTORY
|
7 |
def format_prompt(message, history):
|
8 |
-
|
9 |
-
|
10 |
-
prompt
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
14 |
|
15 |
def compress_history(purpose, task, history):
|
16 |
resp = run_gpt(
|
|
|
5 |
|
6 |
from prompts import GAME_MASTER, COMPRESS_HISTORY
|
7 |
def format_prompt(message, history):
|
8 |
+
prompt=""
|
9 |
+
'''
|
10 |
+
prompt = "<s>"
|
11 |
+
|
12 |
+
for user_prompt, bot_response in history:
|
13 |
+
prompt += f"[INST] {user_prompt} [/INST]"
|
14 |
+
prompt += f" {bot_response}</s> "
|
15 |
+
'''
|
16 |
+
prompt += f"[INST] {message} [/INST]"
|
17 |
+
return prompt
|
18 |
|
19 |
def compress_history(purpose, task, history):
|
20 |
resp = run_gpt(
|