Kackle commited on
Commit
bfee7fa
·
verified ·
1 Parent(s): b6c48b3

Update Gradio_UI.py

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +5 -6
Gradio_UI.py CHANGED
@@ -110,12 +110,11 @@ def pull_messages_from_step(
110
 
111
  # Calculate duration and token information
112
  step_footnote = f"{step_number}"
113
- if hasattr(step_log, "input_token_count") and hasattr(step_log, "output_token_count"):
114
- token_str = ""
115
- if hasattr(step_log, "input_token_count") and step_log.input_token_count is not None:
116
- token_str += f" | Input-tokens:{step_log.input_token_count:,}"
117
- if hasattr(step_log, "output_token_count") and step_log.output_token_count is not None:
118
- token_str += f" | Output-tokens:{step_log.output_token_count:,}"
119
  step_footnote += token_str
120
  if hasattr(step_log, "duration"):
121
  step_duration = f" | Duration: {round(float(step_log.duration), 2)}" if step_log.duration else None
 
110
 
111
  # Calculate duration and token information
112
  step_footnote = f"{step_number}"
113
+ token_str = ""
114
+ if hasattr(step_log, "input_token_count") and step_log.input_token_count is not None:
115
+ token_str += f" | Input-tokens:{step_log.input_token_count:,}"
116
+ if hasattr(step_log, "output_token_count") and step_log.output_token_count is not None:
117
+ token_str += f" | Output-tokens:{step_log.output_token_count:,}"
 
118
  step_footnote += token_str
119
  if hasattr(step_log, "duration"):
120
  step_duration = f" | Duration: {round(float(step_log.duration), 2)}" if step_log.duration else None