Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinilm
Commits
0cddb99e
Commit
0cddb99e
authored
Feb 04, 2026
by
Ceng23333
Browse files
remove usage of stop_token_ids
Signed-off-by:
Ceng23333
<
441651826@qq.com
>
parent
bc93c648
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
11 deletions
+1
-11
python/infinilm/llm/llm.py
python/infinilm/llm/llm.py
+0
-6
python/infinilm/llm/sampling_params.py
python/infinilm/llm/sampling_params.py
+1
-1
python/infinilm/server/inference_server.py
python/infinilm/server/inference_server.py
+0
-4
No files found.
python/infinilm/llm/llm.py
View file @
0cddb99e
...
...
@@ -320,12 +320,6 @@ class LLMEngine:
req
.
finish_reason
=
FinishReason
.
STOP_STRING
return
True
# Check stop token IDs
stop_token_ids
=
req
.
sampling_params
.
stop_token_ids
or
[]
if
stop_token_ids
and
token_id
in
stop_token_ids
:
req
.
finish_reason
=
FinishReason
.
STOP_STRING
return
True
return
False
def
tokenize
(
self
,
text
:
str
)
->
List
[
int
]:
...
...
python/infinilm/llm/sampling_params.py
View file @
0cddb99e
...
...
@@ -15,7 +15,7 @@ class SamplingParams:
top_k
:
int
=
1
max_tokens
:
Optional
[
int
]
=
None
stop
:
Optional
[
List
[
str
]]
=
None
stop_token_ids
:
Optional
[
List
[
int
]]
=
None
stop_token_ids
:
Optional
[
List
[
int
]]
=
None
# Placeholder for future usage, not currently handled
def
__post_init__
(
self
):
if
self
.
stop
is
None
:
...
...
python/infinilm/server/inference_server.py
View file @
0cddb99e
...
...
@@ -233,9 +233,6 @@ class InferenceServer:
if
isinstance
(
stop
,
str
):
stop
=
[
stop
]
stop_token_ids
=
pick
(
"stop_token_ids"
,
None
)
if
isinstance
(
stop_token_ids
,
int
):
stop_token_ids
=
[
stop_token_ids
]
return
SamplingParams
(
temperature
=
float
(
pick
(
"temperature"
,
self
.
temperature
)),
...
...
@@ -243,7 +240,6 @@ class InferenceServer:
top_k
=
int
(
pick
(
"top_k"
,
self
.
top_k
)),
max_tokens
=
int
(
max_tokens
)
if
max_tokens
is
not
None
else
None
,
stop
=
stop
,
stop_token_ids
=
stop_token_ids
,
)
async
def
_stream_chat
(
self
,
request_id
:
str
,
data
:
dict
,
http_request
:
Request
):
...
...
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