MCPcopy Create free account
hub / github.com/ModalityDance/Omni-R1 / time

Method time

src/transformers/utils/notification_service.py:165–181  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

163
164 @property
165 def time(self) -> str:
166 all_results = [*self.model_results.values(), *self.additional_results.values()]
167 time_spent = [r["time_spent"].split(", ")[0] for r in all_results if len(r["time_spent"])]
168 total_secs = 0
169
170 for time in time_spent:
171 time_parts = time.split(":")
172
173 # Time can be formatted as xx:xx:xx, as .xx, or as x.xx if the time spent was less than a minute.
174 if len(time_parts) == 1:
175 time_parts = [0, 0, time_parts[0]]
176
177 hours, minutes, seconds = int(time_parts[0]), int(time_parts[1]), float(time_parts[2])
178 total_secs += hours * 3600 + minutes * 60 + seconds
179
180 hours, minutes, seconds = total_secs // 3600, (total_secs % 3600) // 60, total_secs % 60
181 return f"{int(hours)}h{int(minutes)}m{int(seconds)}s"
182
183 @property
184 def header(self) -> Dict:

Callers 15

speed_metricsFunction · 0.45
_wrap_modelMethod · 0.45
_inner_training_loopMethod · 0.45
evaluateMethod · 0.45
predictMethod · 0.45
evaluation_loopMethod · 0.45
updateMethod · 0.45
__init__Method · 0.45
__call__Method · 0.45
environment_infoMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 2

splitMethod · 0.80
valuesMethod · 0.45