Removes the prefix from the generated text. Args: preds_i (str): The generated text containing the prefix. Returns: str: The generated text without the prefix.
(self, preds_i: str)
| 179 | return res |
| 180 | |
| 181 | def postprocess_remove_prefix(self, preds_i: str) -> str: |
| 182 | """ |
| 183 | Removes the prefix from the generated text. |
| 184 | |
| 185 | Args: |
| 186 | preds_i (str): The generated text containing the prefix. |
| 187 | |
| 188 | Returns: |
| 189 | str: The generated text without the prefix. |
| 190 | """ |
| 191 | return preds_i[len(self.prefix):] |
| 192 | |
| 193 | def streaming_topk_search( |
| 194 | self, |