MCPcopy Index your code
hub / github.com/InternLM/InternLM / initialize_monitor_manager

Function initialize_monitor_manager

internlm/monitor/monitor.py:213–226  ·  view source on GitHub ↗
(job_name: str = None, alert_address: str = None)

Source from the content-addressed store, hash-verified

211
212@contextmanager
213def initialize_monitor_manager(job_name: str = None, alert_address: str = None):
214 if alert_address is not None:
215 try:
216 monitor_manager.start_monitor(job_name=job_name, alert_address=alert_address)
217 monitor_manager.handle_sigterm(alert_address=alert_address)
218 send_alert_message(address=alert_address, message=f"Training in {socket.gethostname()} is starting.")
219 yield
220 finally:
221 send_alert_message(
222 address=gpc.config.alert_address, message=f"Training in {socket.gethostname()} completed."
223 )
224 monitor_manager.stop_monitor()
225 else:
226 yield

Callers 1

train.pyFile · 0.90

Calls 4

send_alert_messageFunction · 0.85
start_monitorMethod · 0.80
handle_sigtermMethod · 0.80
stop_monitorMethod · 0.80

Tested by

no test coverage detected