MCPcopy Create free account
hub / github.com/InternLM/InternBootcamp / update_content

Method update_content

verl/scripts/rollout_viewer.py:292–325  ·  view source on GitHub ↗
(self, search_keyword: Optional[str] = None)

Source from the content-addressed store, hash-verified

290 self.selected_sample_index = offset
291
292 async def update_content(self, search_keyword: Optional[str] = None):
293 content = ""
294 try:
295 samples = self.data[self.selected_step_index].get("samples", [])
296 content_dict_full = samples[self.selected_sample_index]
297
298 # Dynamically track any NEW keys that appear and add them to the field filter.
299 self._update_fields_select(content_dict_full.keys())
300
301 # Apply field selection filter (only show selected fields)
302 content_dict = {k: v for k, v in content_dict_full.items() if k in self.fields_select.selected}
303 if self.render_table:
304 content = Table("key", "value", show_lines=True)
305 for k in content_dict:
306 v = content_dict[k]
307 v = f"{v}"
308 content.add_row(
309 k,
310 self.highlighter(highlight_keyword(v, search_keyword)),
311 )
312 else:
313 text = Text()
314 for k in content_dict:
315 v = content_dict[k]
316 s = center_word_with_equals_exactly(k, 64) + f"\n{v}\n"
317 text.append(highlight_keyword(s, search_keyword))
318 content = self.highlighter(text)
319 except KeyError:
320 content = f"Loading data asynchronously, progress: {len(self.data)}/{self.step_num} step"
321
322 except Exception:
323 content = self.highlighter(traceback.format_exc())
324
325 self.content_display.update(content)
326
327 # ---------------------------------------------------------------------
328 # Request-ID jump logic

Callers 13

on_mountMethod · 0.95
on_reqid_submittedMethod · 0.95
step_changedMethod · 0.95
sample_changedMethod · 0.95
sort_changedMethod · 0.95
fields_changedMethod · 0.95
action_next_stepMethod · 0.95
action_next_sampleMethod · 0.95
action_previous_stepMethod · 0.95
action_swith_renderMethod · 0.95
action_cancel_searchMethod · 0.95

Calls 6

_update_fields_selectMethod · 0.95
highlight_keywordFunction · 0.85
appendMethod · 0.80
getMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected