Spaces:
Runtime error
Runtime error
Matt
commited on
Commit
·
71364cd
1
Parent(s):
76841eb
Bugfix
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def apply_chat_template(template, test_conversation1, test_conversation2):
|
|
27 |
tokenizer.chat_template = template
|
28 |
outputs = []
|
29 |
for i, conversation_str in enumerate((test_conversation1, test_conversation2)):
|
30 |
-
conversation = json.loads(
|
31 |
without_gen = tokenizer.apply_chat_template(conversation, tokenize=False)
|
32 |
with_gen = tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
|
33 |
out = f"Conversation {i}:\n\n{conversation_str}\n\nOutput without generation prompt:\n\n{without_gen}\n\nOutput with generation prompt:\n\n{with_gen}\n\n"
|
|
|
27 |
tokenizer.chat_template = template
|
28 |
outputs = []
|
29 |
for i, conversation_str in enumerate((test_conversation1, test_conversation2)):
|
30 |
+
conversation = json.loads(conversation_str)
|
31 |
without_gen = tokenizer.apply_chat_template(conversation, tokenize=False)
|
32 |
with_gen = tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
|
33 |
out = f"Conversation {i}:\n\n{conversation_str}\n\nOutput without generation prompt:\n\n{without_gen}\n\nOutput with generation prompt:\n\n{with_gen}\n\n"
|