| 19 | super().__init__(**configs) |
| 20 | |
| 21 | def get_data(self) -> Dataset[str, str]: |
| 22 | data = Dataset() |
| 23 | for _ in range(self.count): |
| 24 | x = random.randint(self.range_min, self.range_max) |
| 25 | y = random.randint(self.range_min, self.range_max) |
| 26 | data.append(DataPiece("Your answer should only contain the integer number (without comma), for example, for a question 'what is the answer of 5000 + 5000?', your should print only '10000'. Now, answer the question: What is the answer of {} + {}?".format(x, y), str(x + y))) |
| 27 | return data |
| 28 | |
| 29 | def predict_single(self, session: Session, data_item: str) -> str: |
| 30 | return session.action({"role": "user", "content": data_item}) |