(refactor) argument renaming, add region, do_train and do_predict arguments in finetune.py
Showing
1 changed file
with
10 additions
and
3 deletions
| ... | @@ -212,9 +212,10 @@ class SummarizationModule(BaseTransformer): | ... | @@ -212,9 +212,10 @@ class SummarizationModule(BaseTransformer): |
| 212 | def get_dataset(self, type_path) -> Seq2SeqDataset: | 212 | def get_dataset(self, type_path) -> Seq2SeqDataset: |
| 213 | max_target_length = self.target_lens[type_path] | 213 | max_target_length = self.target_lens[type_path] |
| 214 | data_config = DataConfig( | 214 | data_config = DataConfig( |
| 215 | - endpoint=args.matorage_dir, | 215 | + endpoint=args.endpoint, |
| 216 | access_key=os.environ['access_key'], | 216 | access_key=os.environ['access_key'], |
| 217 | secret_key=os.environ['secret_key'], | 217 | secret_key=os.environ['secret_key'], |
| 218 | + region=args.region, | ||
| 218 | dataset_name='commit-autosuggestions', | 219 | dataset_name='commit-autosuggestions', |
| 219 | additional={ | 220 | additional={ |
| 220 | "mode": ("training" if type_path == "train" else "evaluation"), | 221 | "mode": ("training" if type_path == "train" else "evaluation"), |
| ... | @@ -265,10 +266,16 @@ class SummarizationModule(BaseTransformer): | ... | @@ -265,10 +266,16 @@ class SummarizationModule(BaseTransformer): |
| 265 | help="github url" | 266 | help="github url" |
| 266 | ) | 267 | ) |
| 267 | parser.add_argument( | 268 | parser.add_argument( |
| 268 | - "--matorage_dir", | 269 | + "--endpoint", |
| 269 | type=str, | 270 | type=str, |
| 270 | required=True, | 271 | required=True, |
| 271 | - help='matorage saved directory.' | 272 | + help='matorage endpoint, check document of matorage: https://matorage.readthedocs.io/en/stable/storage.html' |
| 273 | + ) | ||
| 274 | + parser.add_argument( | ||
| 275 | + "--region", | ||
| 276 | + type=str, | ||
| 277 | + default=None, | ||
| 278 | + help='matorage s3 region, check document of matorage: https://matorage.readthedocs.io/en/stable/storage.html' | ||
| 272 | ) | 279 | ) |
| 273 | parser.add_argument( | 280 | parser.add_argument( |
| 274 | "--max_source_length", | 281 | "--max_source_length", | ... | ... |
-
Please register or login to post a comment