-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose stop words and filter eoa #352
Conversation
@Harold-lkk We've changed the stop_words usage in this PR. Please be aware of this. |
I'm currently trying to use lmdeploy. However, I'm hitting a roadblock due to not being able to specify stop words relevant to my model. By when can this PR get merged in? |
Before next Wednesday |
lmdeploy/model.py
Outdated
@@ -539,6 +529,8 @@ def __init__(self, | |||
elif self.capability == 'infilling': | |||
self.top_p = kwargs.get('top_p', 0.9) | |||
self.temperature = kwargs.get('temperature', 0.0) | |||
if self.stop_words is None: | |||
self.stop_words = '<EOT>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the stop words be List[str]
?
lmdeploy/serve/turbomind/chatbot.py
Outdated
@@ -596,6 +606,7 @@ def stream_consumer(postprocess, res_queue, session, n_input_token, | |||
display (bool): display the text in the consolo interface or not | |||
profile_generation (bool): indicator for profiling token generation | |||
eos_id (int): eos token id | |||
stop_words (List[int]): stop words and eos token id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the docstring is different from the arguments of function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Conflicts: lmdeploy/model.py
cca1f21
to
637bfff
Compare
May update test_model.py too. |
|
Conflicts: lmdeploy/model.py
#350