示例#1
0
 def __init__(self, task: BaseTask, data_path: str, output_path: str, model_path: str, resample: str):
     self.task: BaseTask = task
     self.data_path: str = data_path
     self.model_path = model_path
     self.output_path = output_path
     self.task_output_path = os.path.join(self.output_path, task.spec().output_path())
     self.resample = self._parse_resample_string(resample)
     if not os.path.exists(self.task_output_path):
         os.makedirs(self.task_output_path, exist_ok=True)
示例#2
0
 def __init__(self, task: BaseTask, data_path: str, model_path: str, train_size: int, checkpoint: str="model.pt",
              arch: str="roberta_large", fp16: bool=False, token_shapes: bool=False):
     self.task: BaseTask = task
     self.train_size: int = train_size
     self.data_path: str = data_path
     self.task_data_path: str = os.path.join(self.data_path, task.spec().output_path() + "-bin")
     self.model_path: str = model_path
     self.model_name: str = os.path.basename(model_path)
     self.checkpoint: str = checkpoint
     self.arch: str = arch
     self.learning_rate = "1e-5"
     self.fp16 = fp16
     self.token_shapes = token_shapes