MCPcopy Index your code
hub / github.com/THUDM/slime / append

Method append

slime_plugins/rollout_buffer/buffer.py:145–160  ·  view source on GitHub ↗
(self, item)

Source from the content-addressed store, hash-verified

143 self.transform_group_func = transform_group_func or (lambda group, task_type: group)
144
145 def append(self, item):
146 instance_id = item["instance_id"]
147 current_time = time.time()
148
149 # Update timestamp for this group
150 self.group_timestamps[instance_id] = current_time
151
152 if instance_id not in self.temp_data:
153 self.temp_data[instance_id] = [copy.deepcopy(item)]
154 else:
155 self.temp_data[instance_id].append(copy.deepcopy(item))
156
157 if instance_id not in self.data:
158 self.data[instance_id] = [item]
159 else:
160 self.data[instance_id].append(item)
161
162 def _get_valid_groups_with_timeout(self, del_data=False):
163 """Get valid groups including timeout-based groups"""

Callers 15

get_calibration_datasetFunction · 0.80
_normalize_trace_eventsFunction · 0.80
_build_items_from_traceFunction · 0.80
_build_cache_dataFunction · 0.80
process_fileFunction · 0.80
convert_fp8Function · 0.80
analyze_traceFunction · 0.80
print_analysisFunction · 0.80
mainFunction · 0.80
save_tensorsFunction · 0.80

Calls

no outgoing calls

Tested by 15

_simulate_rollout_reportFunction · 0.64
simulateFunction · 0.64
apply_chat_templateMethod · 0.64
fake_generateFunction · 0.64
run_caseFunction · 0.64
apply_chat_templateMethod · 0.64
apply_chat_templateMethod · 0.64
handle_generateMethod · 0.64
flushFunction · 0.64
_parse_sseFunction · 0.64