Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,13 +11,14 @@ def format_prompt(message, history):
|
|
11 |
global system_prompt_sent
|
12 |
prompt = "<s>"
|
13 |
|
14 |
-
if
|
15 |
-
|
16 |
-
|
|
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
|
22 |
prompt += f"[INST] {message} [/INST]"
|
23 |
return prompt
|
@@ -69,7 +70,7 @@ chat_interface = gr.Interface(
|
|
69 |
inputs=[input_text],
|
70 |
outputs=[output_audio, output_text],
|
71 |
live=True,
|
72 |
-
theme="
|
73 |
)
|
74 |
|
75 |
chat_interface.launch(share=True, debug=True)
|
|
|
11 |
global system_prompt_sent
|
12 |
prompt = "<s>"
|
13 |
|
14 |
+
if history is not None and isinstance(history, list):
|
15 |
+
if not any(f"[INST] {system_prompt} [/INST]" in user_prompt for user_prompt, _ in history):
|
16 |
+
prompt += f"[INST] {system_prompt} [/INST]"
|
17 |
+
system_prompt_sent = True
|
18 |
|
19 |
+
for user_prompt, bot_response in history:
|
20 |
+
prompt += f"[INST] {user_prompt} [/INST]"
|
21 |
+
prompt += f" {bot_response}</s> "
|
22 |
|
23 |
prompt += f"[INST] {message} [/INST]"
|
24 |
return prompt
|
|
|
70 |
inputs=[input_text],
|
71 |
outputs=[output_audio, output_text],
|
72 |
live=True,
|
73 |
+
theme="compact",
|
74 |
)
|
75 |
|
76 |
chat_interface.launch(share=True, debug=True)
|