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
ModelZoo
Baichuan-13B_fastllm
Commits
37f12b90
Commit
37f12b90
authored
Jan 11, 2024
by
zhouxiang
Browse files
修复api_server方式下调用非流式接口时的bug
parent
5a6195b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
package/fastllm_pytools/llm.py
package/fastllm_pytools/llm.py
+2
-2
No files found.
package/fastllm_pytools/llm.py
View file @
37f12b90
...
...
@@ -184,7 +184,7 @@ class model:
def
tokenizer_encode_string
(
self
,
content
:
str
)
->
List
[
int
]:
output_buffer_init_len
=
1024
if
self
.
thread_local_obj
.
tokenizer_encode_string__output_buffer
is
None
:
if
not
hasattr
(
self
.
thread_local_obj
,
'tokenizer_encode_string__output_buffer'
)
or
self
.
thread_local_obj
.
tokenizer_encode_string__output_buffer
is
None
:
self
.
thread_local_obj
.
tokenizer_encode_string__output_buffer
=
(
ctypes
.
c_int
*
output_buffer_init_len
)()
buffer
=
self
.
thread_local_obj
.
tokenizer_encode_string__output_buffer
...
...
@@ -212,7 +212,7 @@ class model:
return
cache_result
output_buffer_init_len
=
256
if
self
.
thread_local_obj
.
tokenizer_decode_token__output_buffer
is
None
:
if
not
hasattr
(
self
.
thread_local_obj
,
'tokenizer_decode_token__output_buffer'
)
or
self
.
thread_local_obj
.
tokenizer_decode_token__output_buffer
is
None
:
self
.
thread_local_obj
.
tokenizer_decode_token__output_buffer
=
ctypes
.
create_string_buffer
(
output_buffer_init_len
)
buffer
=
self
.
thread_local_obj
.
tokenizer_decode_token__output_buffer
...
...
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