Logprobs Refractor (#331)
This commit is contained in:
@@ -3,6 +3,7 @@ Usage:
|
||||
python -m sglang.launch_server --model-path meta-llama/Llama-2-7b-chat-hf --port 30000
|
||||
python choices_logprob.py
|
||||
"""
|
||||
|
||||
import sglang as sgl
|
||||
|
||||
|
||||
@@ -19,9 +20,9 @@ def main():
|
||||
print("questions:", question)
|
||||
print("choice:", state["tool"])
|
||||
meta_info = state.get_meta_info("tool")
|
||||
print("logprobs of choice 1", meta_info["prompt_logprob"][0])
|
||||
print("logprobs of choice 2", meta_info["prompt_logprob"][1])
|
||||
print('-' * 50)
|
||||
print("logprobs of choice 1", meta_info["prefill_token_logprobs"][0])
|
||||
print("logprobs of choice 2", meta_info["prefill_token_logprobs"][1])
|
||||
print("-" * 50)
|
||||
|
||||
# Run a batch
|
||||
questions = [
|
||||
@@ -33,9 +34,9 @@ def main():
|
||||
print("questions:", question)
|
||||
print("choice:", state["tool"])
|
||||
meta_info = state.get_meta_info("tool")
|
||||
print("logprobs of choice 1", meta_info["prompt_logprob"][0])
|
||||
print("logprobs of choice 2", meta_info["prompt_logprob"][1])
|
||||
print('-' * 50)
|
||||
print("logprobs of choice 1", meta_info["prefill_token_logprobs"][0])
|
||||
print("logprobs of choice 2", meta_info["prefill_token_logprobs"][1])
|
||||
print("-" * 50)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user