SimpleSam commited on
Commit
33647a1
·
verified ·
1 Parent(s): 2934524

Update Gradio_UI.py

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +4 -3
Gradio_UI.py CHANGED
@@ -112,7 +112,8 @@ def pull_messages_from_step(
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
- f" | Input-tokens:{step_log.input_token_count:,} | Output-tokens:{step_log.output_token_count:,}"
 
116
  )
117
  step_footnote += token_str
118
  if hasattr(step_log, "duration"):
@@ -142,8 +143,8 @@ def stream_to_gradio(
142
  for step_log in agent.run(task, stream=True, reset=reset_agent_memory, additional_args=additional_args):
143
  # Track tokens if model provides them
144
  if hasattr(agent.model, "last_input_token_count"):
145
- total_input_tokens += 54#agent.model.last_input_token_count
146
- total_output_tokens += 55#agent.model.last_output_token_count
147
  if isinstance(step_log, ActionStep):
148
  step_log.input_token_count = agent.model.last_input_token_count
149
  step_log.output_token_count = agent.model.last_output_token_count
 
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
+ #f" | Input-tokens:{step_log.input_token_count:,} | Output-tokens:{step_log.output_token_count:,}"
116
+ f" | Input-tokens:{32} | Output-tokens:{32}"
117
  )
118
  step_footnote += token_str
119
  if hasattr(step_log, "duration"):
 
143
  for step_log in agent.run(task, stream=True, reset=reset_agent_memory, additional_args=additional_args):
144
  # Track tokens if model provides them
145
  if hasattr(agent.model, "last_input_token_count"):
146
+ total_input_tokens += 256 #agent.model.last_input_token_count
147
+ total_output_tokens += 256 #agent.model.last_output_token_count
148
  if isinstance(step_log, ActionStep):
149
  step_log.input_token_count = agent.model.last_input_token_count
150
  step_log.output_token_count = agent.model.last_output_token_count