Spaces:
Sleeping
Sleeping
DylanZimmer commited on
Commit ·
771f748
1
Parent(s): ef63577
explicit bos and eos
Browse files
app.py
CHANGED
|
@@ -19,6 +19,9 @@ system_prompt_default = (
|
|
| 19 |
"Adapt to the user's preferences and communication style."
|
| 20 |
)
|
| 21 |
|
|
|
|
|
|
|
|
|
|
| 22 |
# Helper to manually apply chat template
|
| 23 |
def apply_tiny_chat_template(messages):
|
| 24 |
prompt = ""
|
|
@@ -35,7 +38,7 @@ def apply_tiny_chat_template(messages):
|
|
| 35 |
|
| 36 |
def chat_fxn_caller(message, history, temperature=0.6, top_p=0.95, max_tokens=128):
|
| 37 |
messages = []
|
| 38 |
-
|
| 39 |
# Fix history unpacking for Gradio ChatInterface
|
| 40 |
# history is a flat list of alternating user/assistant messages
|
| 41 |
for i, msg in enumerate(history):
|
|
|
|
| 19 |
"Adapt to the user's preferences and communication style."
|
| 20 |
)
|
| 21 |
|
| 22 |
+
chatbot.tokenizer.bos_token = "<sos>"
|
| 23 |
+
chatbot.tokenizer.eos_token = "<|endoftext|>"
|
| 24 |
+
|
| 25 |
# Helper to manually apply chat template
|
| 26 |
def apply_tiny_chat_template(messages):
|
| 27 |
prompt = ""
|
|
|
|
| 38 |
|
| 39 |
def chat_fxn_caller(message, history, temperature=0.6, top_p=0.95, max_tokens=128):
|
| 40 |
messages = []
|
| 41 |
+
|
| 42 |
# Fix history unpacking for Gradio ChatInterface
|
| 43 |
# history is a flat list of alternating user/assistant messages
|
| 44 |
for i, msg in enumerate(history):
|