Spaces:
Configuration error
Configuration error
Download evaluation/benchmarks/mint/prompts/__init__.py from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 664 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/evaluation/benchmarks/mint/prompts/__init__.py
- Command line
-
hf download hf://spaces/flyingdarkdev/README/evaluation/benchmarks/mint/prompts/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/evaluation/benchmarks/mint/prompts/__init__.py
664 Bytes
| import os | |
| from utils import load_file | |
| PROMPT_DIR = os.path.dirname(__file__) | |
| TEMPLATE_WITH_TOOL = load_file(os.path.join(PROMPT_DIR, 'template_with_tool.txt')) | |
| class PromptTemplate: | |
| """A prompt template.""" | |
| def __init__(self, template: str): | |
| self.template: str = template | |
| def __call__(self, **kwargs) -> str: | |
| return self.template.format(**kwargs) | |
| class ToolPromptTemplate(PromptTemplate): | |
| def __init__(self, use_tool: bool): | |
| if use_tool: | |
| template = TEMPLATE_WITH_TOOL | |
| else: | |
| raise NotImplementedError('Evaluation without tool is not supported yet.') | |
| super().__init__(template) | |