Spaces:
Sleeping
Sleeping
Update Gradio_UI.py
Browse files- 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 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 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
|