| """ Make it more flexible to support alpabetical choices """ | |
| from typing import List, Optional, Union, Callable, Dict, Tuple | |
| from .base import BaseFormatter | |
| class PointwiseFormatter(BaseFormatter): | |
| def prefix(self, **kwargs) -> str: | |
| return "" | |
| def postfix(self, **kwargs) -> str: | |
| return ( | |
| "Is this passage relevant to the query?\n" | |
| "Only respond with Yes or No, do not explain.\nAnswer: " | |
| ) | |
| def body(self, query, doc_list, **kwargs) -> str: | |
| prompts = [] | |
| doc_list = [self._document_format(doc) for doc in doc_list] | |
| for doc in doc_list: | |
| prompt = f"Passage: {doc}\nQuery: {query}\n\n" | |
| prompts.append(prompt) | |
| return prompts | |
Xet Storage Details
- Size:
- 739 Bytes
- Xet hash:
- 4a4194fca4f36495d3b638b950a5ddc4ef90217906117c5355245dc51a041f38
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.