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
Qwen3-30B-A3B_vllm
Commits
8b91cbca
Commit
8b91cbca
authored
Aug 13, 2025
by
zhangwq5
Browse files
修改client
parent
c9d4df8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
30 deletions
+2
-30
infer/online/client.py
infer/online/client.py
+2
-30
No files found.
infer/online/client.py
View file @
8b91cbca
...
@@ -135,44 +135,16 @@ if __name__ == "__main__":
...
@@ -135,44 +135,16 @@ if __name__ == "__main__":
if
thinking_part
:
if
thinking_part
:
print
(
f
"【思考过程】:
{
thinking_part
!
r
}
"
)
print
(
f
"【思考过程】:
{
thinking_part
!
r
}
"
)
print
(
f
"【主要回答】:
{
main_answer
!
r
}
"
)
print
(
f
"【主要回答】:
{
main_answer
!
r
}
"
)
thinking_end_tag
=
'</think>'
logprobs_after_thinking
=
[]
if
thinking_end_tag
in
full_content
and
rank1_logprobs
:
end_char_idx
=
full_content
.
find
(
thinking_end_tag
)
+
len
(
thinking_end_tag
)
current_decoded_length
=
0
for
j
,
logprob_val
in
enumerate
(
rank1_logprobs
):
raw_logprobs_data
=
response_data
[
"choices"
][
0
].
get
(
"logprobs"
,
{}).
get
(
"content"
,
[])
if
j
<
len
(
raw_logprobs_data
):
token_text_from_api
=
raw_logprobs_data
[
j
].
get
(
"token"
,
""
)
current_decoded_length
+=
len
(
token_text_from_api
)
if
current_decoded_length
>
end_char_idx
:
logprobs_after_thinking
=
rank1_logprobs
[
j
:]
break
if
not
logprobs_after_thinking
and
thinking_end_tag
in
full_content
:
print
(
"Warning: Could not accurately find logprobs after </think> tag. Using all logprobs."
)
logprobs_after_thinking
=
rank1_logprobs
elif
not
thinking_end_tag
in
full_content
:
logprobs_after_thinking
=
rank1_logprobs
else
:
logprobs_after_thinking
=
rank1_logprobs
print
(
"
\n
答案部分前10个Token的Rank 1 Logprobs:"
)
print
(
"
\n
答案部分前10个Token的Rank 1 Logprobs:"
)
for
k
,
logprob_val
in
enumerate
(
logprobs
_after_thinking
[:
10
]):
for
k
,
logprob_val
in
enumerate
(
rank1_
logprobs
[:
10
]):
print
(
f
" Step
{
k
}
:
{
logprob_val
:.
4
f
}
"
)
print
(
f
" Step
{
k
}
:
{
logprob_val
:.
4
f
}
"
)
results_to_save
.
append
({
results_to_save
.
append
({
"input"
:
question
,
"input"
:
question
,
"output"
:
main_answer
,
"output"
:
main_answer
,
"logprobs_of_rank1_for_the_first_10_tokens"
:
logprobs
_after_thinking
[:
10
]
"logprobs_of_rank1_for_the_first_10_tokens"
:
rank1_
logprobs
[:
10
]
})
})
print
(
"--------------------------------------------------"
)
print
(
"--------------------------------------------------"
)
...
...
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