Upload standard.py with huggingface_hub
Browse files4 unmodified lines5678910111289101151 unmodified lines636465706667686940 unmodified lines1101111121131141151161171181191201211221231241254 unmodified linesfrom .formats import Format, SystemFormatfrom .logging_utils import get_loggerfrom .operator import SourceSequentialOperator, StreamingOperatorfrom .operators import ( Augmentor, NullAugmentor, StreamRefiner,)from .operators import AddFields, Augmentor, NullAugmentor, StreamRefinerfrom .recipe import Recipefrom .schema import ToUnitxtGroupfrom .splitters import Sampler, SeparateSplit, SpreadSplit51 unmodified lines if self.num_demos > 0: if self.demos_pool_size is None or self.demos_pool_size < 1: raise ValueError( "When using demonstrations both num_demos and demos_pool_size should be assigned with postive integers." "When using demonstrations both num_demos and demos_pool_size should be assigned with positive integers." ) if self.demos_pool_size < self.num_demos: raise ValueError(40 unmodified lines def prepare(self): self.steps = [ self.card.loader, AddFields( fields={ "recipe_metadata": { "card": self.card, "template": self.template, "system_prompt": self.system_prompt, "format": self.format, } } ), ]
if self.loader_limit:standard.py+12-6