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
Lmdeploy
Commits
cb8ac1b0
Unverified
Commit
cb8ac1b0
authored
Jun 29, 2023
by
lvhan028
Committed by
GitHub
Jun 29, 2023
Browse files
fix crash when conversation history out of limit (#28)
parent
c16b857b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
llmdeploy/serve/fastertransformer/chatbot.py
llmdeploy/serve/fastertransformer/chatbot.py
+5
-0
No files found.
llmdeploy/serve/fastertransformer/chatbot.py
View file @
cb8ac1b0
...
@@ -168,6 +168,8 @@ class Chatbot:
...
@@ -168,6 +168,8 @@ class Chatbot:
sequence_start
,
sequence_start
,
sequence_end
):
sequence_end
):
yield
status
,
res
,
tokens
yield
status
,
res
,
tokens
if
status
.
value
<
0
:
return
self
.
_session
.
histories
=
\
self
.
_session
.
histories
=
\
self
.
_session
.
histories
+
self
.
_session
.
prompt
+
\
self
.
_session
.
histories
+
self
.
_session
.
prompt
+
\
self
.
_session
.
response
self
.
_session
.
response
...
@@ -332,7 +334,10 @@ class Chatbot:
...
@@ -332,7 +334,10 @@ class Chatbot:
f
'history tokens
{
session
.
sequence_length
}
, '
\
f
'history tokens
{
session
.
sequence_length
}
, '
\
f
'request length
{
request_output_len
}
'
f
'request length
{
request_output_len
}
'
yield
StatusCode
.
TRITON_SESSION_OUT_OF_LIMIT
,
errmsg
,
0
yield
StatusCode
.
TRITON_SESSION_OUT_OF_LIMIT
,
errmsg
,
0
return
logger
.
info
(
f
'session
{
session
.
session_id
}
, '
logger
.
info
(
f
'session
{
session
.
session_id
}
, '
f
'max length:
{
self
.
cfg
.
session_len
}
, '
f
'input tokens:
{
input_tokens
}
, '
f
'input tokens:
{
input_tokens
}
, '
f
'request tokens:
{
request_output_len
}
, '
f
'request tokens:
{
request_output_len
}
, '
f
'history tokens:
{
session
.
sequence_length
}
'
)
f
'history tokens:
{
session
.
sequence_length
}
'
)
...
...
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