[Feat] Return hidden states (experimental) (#3364)
Co-authored-by: Chayenne <zhaochen20@outlook.com>
This commit is contained in:
@@ -796,6 +796,12 @@ class TokenizerManager:
|
||||
}
|
||||
)
|
||||
|
||||
if (
|
||||
hasattr(recv_obj, "output_hidden_states")
|
||||
and len(recv_obj.output_hidden_states[i]) > 0
|
||||
):
|
||||
meta_info["hidden_states"] = recv_obj.output_hidden_states[i]
|
||||
|
||||
if isinstance(recv_obj, BatchStrOut):
|
||||
out_dict = {
|
||||
"text": recv_obj.output_strs[i],
|
||||
|
||||
Reference in New Issue
Block a user