MCPcopy Create free account
hub / github.com/AkaliKong/MiniOneRec / pre

Method pre

data.py:242–259  ·  view source on GitHub ↗
(self, idx)

Source from the content-addressed store, hash-verified

240 "dedup": target_item_id == last_history_item_id}
241
242 def pre(self, idx):
243 instruction = f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
244
245### Instruction:
246{self.instructs[random.randint(0, len(self.instructs)-1)]}\n
247"""
248 history = self.get_history(self.data.iloc[idx])
249 target_item = history['output']
250 history['output'] = ''
251
252 prompt = self.generate_prompt(history)
253 self.prompt2history[instruction + prompt] = history["history_str"]
254 self.history2target[history["history_str"]] = target_item
255
256 return {
257 "prompt": instruction + prompt,
258 "completion": target_item,
259 }
260
261
262class EvalD3Dataset(CSVBaseDataset):

Callers

nothing calls this directly

Calls 2

get_historyMethod · 0.95
generate_promptMethod · 0.45

Tested by

no test coverage detected