Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
7275d496
"vscode:/vscode.git/clone" did not exist on "1fc50263477dc32c1ea987e8243b355bd246ec8e"
Unverified
Commit
7275d496
authored
May 14, 2025
by
Ryan McCormick
Committed by
GitHub
May 15, 2025
Browse files
feat: Add ignore_eos/nvext support for legacy completions (#1080)
parent
b813befa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
examples/tensorrt_llm/components/processor.py
examples/tensorrt_llm/components/processor.py
+13
-0
No files found.
examples/tensorrt_llm/components/processor.py
View file @
7275d496
...
@@ -174,5 +174,18 @@ class Processor(ChatProcessorMixin):
...
@@ -174,5 +174,18 @@ class Processor(ChatProcessorMixin):
@
dynamo_endpoint
(
name
=
"completions"
)
@
dynamo_endpoint
(
name
=
"completions"
)
async
def
completions
(
self
,
raw_request
:
DynamoTRTLLMCompletionRequest
):
async
def
completions
(
self
,
raw_request
:
DynamoTRTLLMCompletionRequest
):
# min_tokens isn't currently propagated through the Rust OpenAI HTTP frontend,
# and ignore_eos is passed through the 'nvext' field, so set both when found.
if
raw_request
.
nvext
:
ignore_eos
=
raw_request
.
nvext
.
get
(
"ignore_eos"
)
raw_request
.
ignore_eos
=
ignore_eos
# If ignore_eos is True, set min_tokens to max_tokens to guarantee
# the full expected OSL for consistent benchmarking purposes.
if
ignore_eos
:
logger
.
debug
(
f
"[preprocessor] `ignore_eos` detected, setting `min_tokens` to `max_tokens`:
{
raw_request
.
max_tokens
}
"
)
raw_request
.
min_tokens
=
raw_request
.
max_tokens
async
for
response
in
self
.
_generate
(
raw_request
,
RequestType
.
COMPLETION
):
async
for
response
in
self
.
_generate
(
raw_request
,
RequestType
.
COMPLETION
):
yield
response
yield
response
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment