Skip to content

Commit

Permalink
Merge pull request huggingface#21 from microsoft/aibhanda/dev_options
Browse files Browse the repository at this point in the history
Add ORT internal options config flag
  • Loading branch information
raviskolli authored Aug 26, 2021
2 parents 2faedf4 + 9109e4f commit e4e57f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/transformers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,9 @@ def train(
from torch_ort import ORTModule
logger.info("Converting to ORTModule ....")
model = ORTModule(self.model)
if args.ort_config_file:
from torch_ort.experimental.json_config import load_from_json
load_from_json(model, path=args.ort_config_file)
self.model_wrapped = model
if args.deepspeed:
if args.ort:
Expand Down
4 changes: 4 additions & 0 deletions src/transformers/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,10 @@ class TrainingArguments:
default=False,
metadata={"help": "Enable Ort"},
)
ort_config_file: Optional[str] = field(
default=None,
metadata={"help": "Configure ORTModule internal options"},
)
label_smoothing_factor: float = field(
default=0.0, metadata={"help": "The label smoothing epsilon to apply (zero means no label smoothing)."}
)
Expand Down

0 comments on commit e4e57f0

Please sign in to comment.