(self)
| 86 | self.run_id_base = run_id_base |
| 87 | |
| 88 | def run(self): |
| 89 | exps = [] |
| 90 | if self.output_format == "json": |
| 91 | import json |
| 92 | |
| 93 | for i in range(self.repeat_times): |
| 94 | exp = Experience(tokens=Tensor([0, 1, 2, 3]), prompt_length=1) |
| 95 | exp.response_text = json.dumps(self.obj) |
| 96 | exps.append(exp) |
| 97 | return exps |
| 98 | elif self.output_format == "yaml": |
| 99 | import yaml |
| 100 | |
| 101 | for i in range(self.repeat_times): |
| 102 | exp = Experience(tokens=Tensor([0, 1, 2, 3]), prompt_length=1) |
| 103 | exp.response_text = yaml.safe_dump(self.obj) |
| 104 | exps.append(exp) |
| 105 | return exps |
| 106 | else: |
| 107 | raise ValueError("Invalid output format") |
| 108 | |
| 109 | |
| 110 | class DummyAsyncWorkflow(Workflow): |
no test coverage detected