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
2cec992f
Commit
2cec992f
authored
Nov 15, 2023
by
zhouxiang
Browse files
修复batch推理bug
parent
15d855b9
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 @
2cec992f
...
@@ -483,7 +483,7 @@ class model:
...
@@ -483,7 +483,7 @@ class model:
response
=
ctypes
.
string_at
(
outputs
[
i
]).
decode
()
response
=
ctypes
.
string_at
(
outputs
[
i
]).
decode
()
responses
.
append
(
response
)
responses
.
append
(
response
)
historys
[
i
]
=
historys
[
i
]
+
[(
querys
[
i
],
response
)]
historys
[
i
]
=
historys
[
i
]
+
[(
querys
[
i
],
response
)]
fastllm_lib
.
freeCharArray
(
outputs
)
fastllm_lib
.
freeCharArray
(
outputs
,
query_size
)
return
responses
,
historys
return
responses
,
historys
def
chat_batch
(
self
,
tokenizer
,
querys
:
List
[
str
],
historys
:
List
[
List
[
Tuple
[
str
,
str
]]]
=
None
,
max_length
:
int
=
1024
,
def
chat_batch
(
self
,
tokenizer
,
querys
:
List
[
str
],
historys
:
List
[
List
[
Tuple
[
str
,
str
]]]
=
None
,
max_length
:
int
=
1024
,
...
@@ -511,7 +511,7 @@ class model:
...
@@ -511,7 +511,7 @@ class model:
response
=
ctypes
.
string_at
(
outputs
[
i
]).
decode
()
response
=
ctypes
.
string_at
(
outputs
[
i
]).
decode
()
responses
.
append
(
response
)
responses
.
append
(
response
)
historys
[
i
]
=
historys
[
i
]
+
[(
querys
[
i
],
response
)]
historys
[
i
]
=
historys
[
i
]
+
[(
querys
[
i
],
response
)]
fastllm_lib
.
freeCharArray
(
outputs
)
fastllm_lib
.
freeCharArray
(
outputs
,
query_size
)
return
responses
,
historys
return
responses
,
historys
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