| ## TODO: dynamically shrink the body size via length of documents? | |
| ## NOTE: shall we move this to the upper root? | |
| from .listwise import ListwiseFormatter | |
| from .pairwise import PairwiseFormatter | |
| from .setwise import SetwiseFormatter | |
| from .pointwise import PointwiseFormatter | |
| from .judge import JudgeFormatter | |
| from ._dev import DevFormatter | |
| class AutoPromptFormatter: | |
| _builder_map = { | |
| 'RankZephyr': ListwiseFormatter, | |
| 'RankGPT': ListwiseFormatter, | |
| 'RankGPT+': ListwiseFormatter, | |
| 'RankFirst': ListwiseFormatter, | |
| 'PairAll': PairwiseFormatter, | |
| 'PairTopK': PairwiseFormatter, | |
| 'PairMaxHeapTopK': PairwiseFormatter, | |
| 'SetTopK': SetwiseFormatter, | |
| 'SetMaxHeapTopK': SetwiseFormatter, | |
| 'Point': PointwiseFormatter, | |
| 'Judge': JudgeFormatter, | |
| 'Lancer': JudgeFormatter, | |
| 'Dev': DevFormatter, | |
| } | |
| def from_config(cls, config): | |
| rerank_mode = config.rerank_mode | |
| builder_cls = cls._builder_map.get(rerank_mode) | |
| if builder_cls is None: | |
| raise ValueError( | |
| f"No prompt builder found for mode: {rerank_mode}\n" | |
| f"available modes: {list(cls._builder_map.keys())}" | |
| ) | |
| return builder_cls(config) | |
Xet Storage Details
- Size:
- 1.29 kB
- Xet hash:
- 7eaa039c32f2b98335802dfe003c794ab4f1cbffcf6c9a01fa1db5f4be3df67a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.