Skip to content
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

Add max_new_tokens to MPT handler #396

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/inference-deployments/mpt/mpt_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
class MPTModelHandler():

DEFAULT_GENERATE_KWARGS = {
'max_length': 256,
'max_length': 256, # Counts input + output tokens (deprecated)
'max_new_tokens': 256, # Only counts output tokens
'use_cache': True,
'do_sample': True,
'top_p': 0.95,
Expand Down Expand Up @@ -76,7 +77,7 @@ def predict(self, model_requests: List[Dict]):
model_requests: List of dictionaries that contain forward pass inputs as well
as other parameters, such as generate kwargs.

ex. [{'input': 'hello world!', 'parameters': {'max_length': 10}]
ex. [{'input': 'hello world!', 'parameters': {'max_new_tokens': 10}]
"""
generate_inputs = []
generate_kwargs = {}
Expand Down