Commit 25e1b55 Sebastian Sosa
committed
1 parent b467d5b commit 25e1b55 Copy full SHA for 25e1b55
File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def token_prob_difference(
17
17
]
18
18
initial_tokens = [content .token for content in initial_logprobs .content ]
19
19
20
- # Create a list of dictionaries with token and logprob from perturbed_logprobs
20
+ # Create a list of dictionaries with token and top logprobs from perturbed_logprobs
21
21
perturbed_token_logprobs_list = [
22
22
{
23
23
top_logprob .token : top_logprob .logprob
@@ -70,11 +70,13 @@ def token_displacement(
70
70
return displacement_per_token .mean (), initial_tokens , displacement_per_token
71
71
72
72
73
- def max_logprob_difference (
73
+ # NOTE: this metric does not work. It's left to serve as discussion
74
+ def deprecated_max_logprob_difference (
74
75
initial_logprobs : openai .types .chat .chat_completion .ChoiceLogprobs ,
75
76
perturbed_logprobs : openai .types .chat .chat_completion .ChoiceLogprobs ,
76
77
):
77
78
# Get the logprobs of the top 20 tokens for the initial and perturbed outputs
79
+ # Warning: this should probably be a list with the top logprobs at each token position instead
78
80
initial_top_logprobs = {
79
81
logprob .token : logprob .logprob for logprob in initial_logprobs .content
80
82
}
You can’t perform that action at this time.
0 commit comments