Overhaul Conversation class and prompt templating #25323
Rocketknight1
changed the title Customizable prompt templates for Llama Overhaul Conversation class and prompt templating 3 years ago
gante
commented
on 2023-08-21
gante
approved these changes
on 2023-08-23
lewtun
commented
on 2023-08-24
First commit while I figure this out
951877a9
make fixup
11b70a10
Remove unused method
cee4b8f0
Store prompt attrib
7eb4acf3
Fix prompt argument for tests
3a10c21f
Make same changes in fast tokenizer
e371ad05
Remove global prompts from fast tokenizer too
9a3fabe6
stash commit
bc02ec30
stash commit
1073f41e
Migrate PromptConfig to its True Final Location
a998e67b
Replace Conversation entirely with the new class
3f8b5e5e
Import/dependency fixes
03073a94
Import/dependency fixes
9a989b51
Change format for lots of default prompts
f4b5f60f
More default prompt fixups
9a9a7df6
Revert llama old methods so we can compare
3ec05dd3
Fix some default configs
32b4b70a
Fix some default configs
d3cbe7b8
Fix misspelled kwarg
cd10921a
Fixes for Blenderbot
358ebe28
make fixup
035a197c
little rebase cleanup
120c2a97
Add basic documentation
9cad5cf8
Quick doc fix
7533c049
Truncate docstring for now
1d38fc71
Add handling for the case when messages is a single string
d8d4bac3
Quick llama merges
3a9c5542
Update conversational pipeline and tests
dd94a3dd
Add a couple of legacy properties for backward compatibility
804fba38
More legacy handling
8cf91639
Add docstring for build_conversation_input_ids
a53ab35f
Restructure PromptConfig
95851156
Let's start T E M P L A T I N G
3d6e43dd
Refactor all default configs to use templates instead
dfabb720
Revert changes to the special token properties since we don't need th…
746c0598
More class templates
ffad592d
Make the sandbox even sandier
0b2a3c9e
Everything replaced with pure templating
48824324
Remove docs for PromptConfig
67f8c7c1
Add testing and optional requirement boilerplate
bf97caa8
Fix imports and make fixup
f9f32a5f
Fix LLaMA tests and add Conversation docstring
1eafda93
Finally get LLaMA working with the template system
2da9359e
Finally get LLaMA working with the template system
1d2ec0ac
make fixup
9b13770a
make fixup
7cbc7a5c
fmt-off for the long lists of test tokens
686bfb98
Rename method to apply_chat_template for now
ccfa809e
Start on documentation
19dfaec7
Make chat_template a property that reads through to the default if it…
0ba6e7bb
Expand docs
520c39f4
Expand chat templating doc some more
8919f785
trim/lstrip blocks by default and update doc
bc9a723d
Few doc tweaks
d9ef5347
rebase cleanup
d569f3b9
Clarify docstring
9d896e73
trim/lstrip blocks by default and update doc
bc9a723d
Few doc tweaks
d9ef5347
rebase cleanup
d569f3b9
rebase cleanup
da7e6c8f
rebase cleanup
e745e204
Re-add PEFT check
f26222e0
Explain system messages in the doc
8eae7555
Add chat template test
4eb475e3
Proper save-loading for chat template attribute
8bf8d271
Add test skips for layout models
a06871be
Remove _build_conversation_input_ids, add default_chat_template to co…
6d255915
Make sure all LLaMA models are using the latest template
dae3818d
Remove default_system_prompt block in code_llama because it has no de…
7dd151e4
Update ConversationPipeline preprocess
9b3ae733
Add correct #Copied from links to the default_chat_templates
78be378d
Remove unneeded type checking line
a8433847
Add a dummy mark_processsed method
f771054e
Reorganize Conversation to have **deprecated_kwargs
5a747bb1
Update chat_templating.md
1a09fd26
Quick fix to LLAMA tests
4878481f
Small doc tweaks
67315a21
Add proper docstrings and "copied from" statements to all default cha…
eb4e4ab6
Merge use_default_system_prompt support for code_llama too
541bc84e
Improve clarity around self.chat_template
1d3678c7
Docstring fix
16f44035
Fix blenderbot default template
01168c66
More doctest fix
2dcc3b74
Break out some tokenizer kwargs
266bef69
Update doc to explain default templates
61b8e6cc
Quick tweaks to tokenizer args
80aa6161
Cleanups for tokenizer args
b46edbec
Add note about cacheing
7ec4c65d
Quick tweak to the chat-templating doc
a84d793c
Update the LLaMA template with error checking and correct system mess…
72cc3344
make fixup
9578353d
make fixup
94e8a604
add requires_jinja
34ddb16c
Cleanup to expected output formatting
9725478f
Add cacheing
1f903fa3
Fix typo in llama default template
4f71b404
Update LLaMA tests
3dc4c79a
Update documentation
619ccf4b
Improved legacy handling in the Conversation class
3bf1d2c5
Update Jinja template with proper error handling
afa6b32e
Quick bugfix
b34050b2
Proper exception raising
40d9fa24
Change cacheing behaviour so it doesn't try to pickle an entire Jinja…
8f847299
make fixup
f3c4922b
rebase cleanup
a10d52b6
Rocketknight1
deleted the customizable_prompt_template branch 3 years ago
Assignees
No one assigned
Login to write a write a comment.
Login via GitHub