Upload common.py with huggingface_hub
Browse files10 unmodified lines1112131415161720 unmodified lines383940404141424344452 unmodified lines484950505152535410 unmodified lines
class CommonRecipe(Recipe, SourceOperator): card: TaskCard demos_pool_name: str = "demos_pool" demos_pool_size: int = None20 unmodified lines steps.append( SliceSplit( slices={ self.demos_pool_name: f"train[:{self.demos_pool_size}]", "train": f"train[{self.demos_pool_size}:]", self.demos_pool_name: f"train[:{int(self.demos_pool_size)}]", "train": f"train[{int(self.demos_pool_size)}:]", "validation": "validation", "test": "test", }2 unmodified lines
if self.num_demos is not None: if self.sampler_type == "random": sampler = RandomSampler(sample_size=self.num_demos) sampler = RandomSampler(sample_size=int(self.num_demos))
steps.append( SpreadSplit(common.py+4-3