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
OpenDAS
ktransformers
Commits
038db30e
Unverified
Commit
038db30e
authored
Apr 13, 2025
by
wang jiahao
Committed by
GitHub
Apr 13, 2025
Browse files
Merge pull request #1132 from wangkuigang-yewu-cmss/long-prompt-crash
使用长prompt时,避免rpc进程挂掉
parents
797dac7e
4538bdae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
ktransformers/server/backend/interfaces/balance_serve.py
ktransformers/server/backend/interfaces/balance_serve.py
+4
-0
No files found.
ktransformers/server/backend/interfaces/balance_serve.py
View file @
038db30e
...
...
@@ -374,6 +374,10 @@ class BalanceServeInterface(BackendInterfaceBase):
top_p
=
0.0001
query_add
.
sample_options
.
top_p
=
top_p
query_add
.
estimated_length
=
min
(
self
.
args
.
cache_lens
,
query_length
+
self
.
args
.
max_new_tokens
)
if
query_add
.
estimated_length
<
query_add
.
query_length
:
raise
Exception
(
f
'query too long: estimated_length=
{
query_add
.
estimated_length
}
< query_length=
{
query_add
.
query_length
}
'
)
query_id
=
self
.
sched_client
.
add_query
(
query_add
)
queue
=
asyncio
.
Queue
(
maxsize
=
self
.
args
.
max_new_tokens
)
self
.
queue_map
[
query_id
]
=
queue
...
...
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