Download instructions.py from unitxt/data: direct link, hf CLI and curl.
- Browser
- Download file 706 Bytes
-
https://huggingface.co/datasets/unitxt/data/resolve/175f6e2aa0fa60b211efee6eec0f334080d771ae/instructions.py
- Command line
-
hf download hf://datasets/unitxt/data@175f6e2aa0fa60b211efee6eec0f334080d771ae/instructions.py
-
curl -L -o instructions.py https://huggingface.co/datasets/unitxt/data/resolve/175f6e2aa0fa60b211efee6eec0f334080d771ae/instructions.py
706 Bytes
| from abc import ABC, abstractmethod | |
| from typing import Dict | |
| from .artifact import Artifact | |
| class Instruction(Artifact): | |
| def __call__(self) -> str: | |
| pass | |
| class TextualInstruction(Instruction): | |
| text: str | |
| def __call__(self) -> str: | |
| return self.text | |
| def __repr__(self): | |
| return self.text | |
| from .collections import ListCollection | |
| class InstructionsList(ListCollection): | |
| def verify(self): | |
| for instruction in self.items: | |
| assert isinstance(instruction, Instruction) | |
| class InstructionsDict(Dict): | |
| def verify(self): | |
| for key, instruction in self.items(): | |
| assert isinstance(instruction, Instruction) | |