(self, idx)
| 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 | |
| 262 | class EvalD3Dataset(CSVBaseDataset): |
nothing calls this directly
no test coverage detected