You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that when I manage my history, chat_history is automatically converted into the following format:
System: you are a student.
Human: hello
However, this format is not what I want. For example, in the transformers library, I can use tokenizer.apply_chat_template to add special tokens to keep it consistent with the training. But I cannot reformat the chat_history template from the code because it has already been converted to the default format in the LLM's _call method's prompt parameter. I also don't know how to access the history in the LLM's _call method or how to rewrite RunnableWithMessageHistory to format historical messages, as the RunnableWithMessageHistory class doesn't seem to have an interface for this purpose.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
I noticed that when I manage my history,
chat_history
is automatically converted into the following format:However, this format is not what I want. For example, in the
transformers
library, I can usetokenizer.apply_chat_template
to add special tokens to keep it consistent with the training. But I cannot reformat thechat_history
template from the code because it has already been converted to the default format in theLLM
's_call
method'sprompt
parameter. I also don't know how to access the history in theLLM
's_call
method or how to rewriteRunnableWithMessageHistory
to format historical messages, as theRunnableWithMessageHistory
class doesn't seem to have an interface for this purpose.Motivation
empty
Proposal (If applicable)
No response
Beta Was this translation helpful? Give feedback.
All reactions