-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
82 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# flake8: noqa | ||
|
||
from .data import DataTrainingArguments, TextGenerationDataset | ||
from .model_args import ModelArguments | ||
from .data import TextGenerationDataset | ||
from .session_mixin import SessionManagerMixIn | ||
from .text_generation import apply, compress, eval, oneshot, train | ||
from .training_args import TrainingArguments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# flake8: noqa | ||
|
||
from .data_arguments import DatasetArguments | ||
from .model_arguments import ModelArguments | ||
from .recipe_arguments import RecipeArguments | ||
from .training_arguments import TrainingArguments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from dataclasses import fields | ||
from typing import Any, Dict, Union | ||
|
||
from .data_arguments import DatasetArguments | ||
from .model_arguments import ModelArguments | ||
from .recipe_arguments import RecipeArguments | ||
from .training_arguments import TrainingArguments | ||
|
||
|
||
def get_dataclass_as_dict( | ||
dataclass_instance: Union[ | ||
"ModelArguments", "RecipeArguments", "DatasetArguments", "TrainingArguments" | ||
], | ||
dataclass_class: Union[ | ||
"ModelArguments", "RecipeArguments", "DatasetArguments", "TrainingArguments" | ||
], | ||
) -> Dict[str, Any]: | ||
""" | ||
Get the dataclass instance attributes as a dict, neglicting the inherited class. | ||
Ex. dataclass_class=TrainingArguments will ignore HFTrainignArguments | ||
""" | ||
return { | ||
field.name: getattr(dataclass_instance, field.name) | ||
for field in fields(dataclass_class) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters