From cb4c56ce0dfa1350267ed28e57760986a58a9ba4 Mon Sep 17 00:00:00 2001 From: Francisco R Castro Garcia Date: Tue, 10 Jun 2025 07:43:35 -0600 Subject: [PATCH] Fix typo in Language Modeling example scripts and update TPU type (#38652) * Fix typo that prevents the examples to be run correctly * return .TPU in accelerator.distributedtype comparison --- examples/pytorch/language-modeling/run_fim.py | 2 +- examples/pytorch/language-modeling/run_fim_no_trainer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pytorch/language-modeling/run_fim.py b/examples/pytorch/language-modeling/run_fim.py index 7653eb6308..eca05c10dc 100644 --- a/examples/pytorch/language-modeling/run_fim.py +++ b/examples/pytorch/language-modeling/run_fim.py @@ -521,7 +521,7 @@ def main(): # Get the factor by which the embedding layer should be padded based on the device pad_factor = 1 - if torch.cuda.is_availble(): + if torch.cuda.is_available(): pad_factor = 8 elif is_torch_xla_available(check_is_tpu=True): diff --git a/examples/pytorch/language-modeling/run_fim_no_trainer.py b/examples/pytorch/language-modeling/run_fim_no_trainer.py index 2f8e8024e8..654b870025 100644 --- a/examples/pytorch/language-modeling/run_fim_no_trainer.py +++ b/examples/pytorch/language-modeling/run_fim_no_trainer.py @@ -488,7 +488,7 @@ def main(): # Get the factor by which the embedding layer should be padded based on the device pad_factor = 1 - if torch.cuda.is_availble(): + if torch.cuda.is_available(): pad_factor = 8 elif is_torch_xla_available(check_is_tpu=True):