Commit 586ee38 1 parent d521257 commit 586ee38 Copy full SHA for 586ee38
File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -549,9 +549,10 @@ def compute_efficiency_metrics(
549
549
550
550
# Total number of tokens in the completion.
551
551
num_completion_tokens : int = sum ([len (completion .tokens ) for completion in request_state .result .completions ])
552
- # Assume that tokens for different completions are generated sequentially (instead of batched).
553
- num_output_tokens : int = num_completion_tokens
554
552
# Don't include prompt in number of generated tokens (e.g., for language modeling).
553
+ # Assume that tokens for different completions are generated sequentially (instead of batched) when
554
+ # computing num_output_tokens (for the purpose of runtime estimation).
555
+ num_output_tokens : int = num_completion_tokens
555
556
if request_state .request .echo_prompt :
556
557
# num_prompt_tokens > num_output_tokens can happen if tokenizer doesn't round trip.
557
558
if num_prompt_tokens <= num_output_tokens :
@@ -588,7 +589,6 @@ def compute_efficiency_metrics(
588
589
else :
589
590
training_energy_cost = None
590
591
591
- # TODO: unify num_completion_tokens and num_output_tokens.
592
592
stats = [
593
593
Stat (MetricName ("num_prompt_tokens" )).add (num_prompt_tokens ),
594
594
Stat (MetricName ("num_completion_tokens" )).add (num_completion_tokens ),
Original file line number Diff line number Diff line change @@ -913,7 +913,7 @@ metric_groups:
913
913
split : ${main_split}
914
914
- name : num_prompt_tokens
915
915
split : ${main_split}
916
- - name : num_completion_tokens
916
+ - name : num_output_tokens
917
917
split : ${main_split}
918
918
- name : num_train_trials
919
919
split : ${main_split}
You can’t perform that action at this time.
0 commit comments