Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 26, 2023
1 parent 19b831f commit 772f93b
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 28 deletions.
7 changes: 5 additions & 2 deletions examples/nlp/language_modeling/megatron_t5_prompt_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@
within this examples directory to convert your model to .nemo format.
"""

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_t5_prompt_learning.yaml")
def main(cfg) -> None:
logging.info("\n\n************** Experiment configuration ***********")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@
if not torch.cuda.is_available():
raise EnvironmentError("GPU is needed for the inference")

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_t5_prompt_learning_inference")
def main(cfg) -> None:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@
if not torch.cuda.is_available():
raise EnvironmentError("GPU is needed for the inference")

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronGPTSFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_gpt_peft_tuning.py` and `megatron_gpt_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronGPTSFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_gpt_peft_tuning.py` and `megatron_gpt_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_gpt_adapter_inference")
def main(cfg) -> None:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@
trainer.max_epochs=2
"""

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronGPTSFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_gpt_peft_tuning.py` and `megatron_gpt_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronGPTSFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_gpt_peft_tuning.py` and `megatron_gpt_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_gpt_adapter_tuning_config")
def main(cfg) -> None:
logging.info("\n\n************** Experiment configuration ***********")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@
if not torch.cuda.is_available():
raise EnvironmentError("GPU is needed for the inference")

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronGPTSFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_gpt_peft_tuning.py` and `megatron_gpt_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronGPTSFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_gpt_peft_tuning.py` and `megatron_gpt_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_gpt_adapter_inference")
def main(cfg) -> None:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@
trainer.max_epochs=2
"""

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronGPTSFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_gpt_peft_tuning.py` and `megatron_gpt_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronGPTSFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_gpt_peft_tuning.py` and `megatron_gpt_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_gpt_ia3_tuning_config")
def main(cfg) -> None:
logging.info("\n\n************** Experiment configuration ***********")
Expand Down
7 changes: 5 additions & 2 deletions examples/nlp/language_modeling/tuning/megatron_gpt_sft.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ def validate_checkpoint_loading_args(cfg):
if cfg.hparams_file is None or not os.path.isfile(cfg.hparams_file):
raise ValueError(f'Hparams file {cfg.hparams_file} does not exist or is not a file.')

@deprecated(explanation=f"{__file__} is deprecated. PEFT and SFT scripts are now consolidated"
"See updated scripts `megatron_gpt_peft_tuning.py` and `megatron_gpt_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. PEFT and SFT scripts are now consolidated"
"See updated scripts `megatron_gpt_peft_tuning.py` and `megatron_gpt_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_gpt_sft")
def main(cfg) -> None:
logging.info("\n\n************** Experiment configuration ***********")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@
if not torch.cuda.is_available():
raise EnvironmentError("GPU is needed for the inference")

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_t5_adapter_inference")
def main(cfg) -> None:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@
trainer.max_epochs=2
"""

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_t5_adapter_tuning_config")
def main(cfg) -> None:
logging.info("\n\n************** Experiment configuration ***********")
Expand Down
7 changes: 5 additions & 2 deletions examples/nlp/language_modeling/tuning/megatron_t5_ia3_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@
if not torch.cuda.is_available():
raise EnvironmentError("GPU is needed for the inference")

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_t5_ia3_inference")
def main(cfg) -> None:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@
trainer.max_epochs=2
"""

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_t5_ia3_tuning_config")
def main(cfg) -> None:
logging.info("\n\n************** Experiment configuration ***********")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@
if not torch.cuda.is_available():
raise EnvironmentError("GPU is needed for the inference")

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_t5_adapter_inference")
def main(cfg) -> None:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@
trainer.max_epochs=2
"""

@deprecated(explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples.")

@deprecated(
explanation=f"{__file__} is deprecated. Please use MegatronT5SFTModel.add_adapter() for PEFT features."
"See updated scripts `megatron_t5_peft_tuning.py` and `megatron_t5_peft_eval.py` for examples."
)
@hydra_runner(config_path="conf", config_name="megatron_t5_lora_tuning_config")
def main(cfg) -> None:
logging.info("\n\n************** Experiment configuration ***********")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@

HAVE_MEGATRON_CORE = False

@deprecated(explanation="Please use MegatronGPTSFTModel.add_adapter() for PEFT features."
"See the updated `megatron_gpt_peft_tuning.py` for an example.")

@deprecated(
explanation="Please use MegatronGPTSFTModel.add_adapter() for PEFT features."
"See the updated `megatron_gpt_peft_tuning.py` for an example."
)
class MegatronGPTPEFTModel(MegatronGPTSFTModel):
"""
base class for all mixin based adapter models
Expand Down

0 comments on commit 772f93b

Please sign in to comment.