Integrating huggingface chat templates#281
Integrating huggingface chat templates#281SamGalanakis wants to merge 5 commits intoeth-sri:mainfrom
Conversation
|
Thanks for starting on this. I made some smaller changes based on your fork and pushed it to branch PromptInterpreter itself must not have any state like Instead, all state in PromptInterpreter is encapsulated in Let me know if this makes sense, otherwise I can also have another look. Thanks a lot. |
|
Thanks, yeah that makes sense will work on the branch and and let you know. |
|
Closing this in favour of the other more advanced PR #293. |
Been having a lot of trouble with chat templates especially when switching between models frequently. This is a very rough implementation of how we might be able to integrate them into lmql using existing jinja templates from huggingface. Essentialy you just pass a jinja template as you do for huggingface tokenizers and when using the existing lmql role tags the appropriate chat template will be applied for you. Any feedback/ ideas welcome.
Can test it with the below script: