Unverified Commit 431ab19d authored by Sam Shleifer's avatar Sam Shleifer Committed by GitHub
Browse files

[fix] typo in available in helper function (#6859)

parent 367235ee
...@@ -53,7 +53,7 @@ def get_setup_file(): ...@@ -53,7 +53,7 @@ def get_setup_file():
return args.f return args.f
def is_cuda_and_apex_avaliable(): def is_cuda_and_apex_available():
is_using_cuda = torch.cuda.is_available() and torch_device == "cuda" is_using_cuda = torch.cuda.is_available() and torch_device == "cuda"
return is_using_cuda and is_apex_available() return is_using_cuda and is_apex_available()
...@@ -85,7 +85,7 @@ class ExamplesTests(TestCasePlus): ...@@ -85,7 +85,7 @@ class ExamplesTests(TestCasePlus):
testargs += "--output_dir " + output_dir testargs += "--output_dir " + output_dir
testargs = testargs.split() testargs = testargs.split()
if is_cuda_and_apex_avaliable(): if is_cuda_and_apex_available():
testargs.append("--fp16") testargs.append("--fp16")
with patch.object(sys, "argv", testargs): with patch.object(sys, "argv", testargs):
...@@ -115,7 +115,7 @@ class ExamplesTests(TestCasePlus): ...@@ -115,7 +115,7 @@ class ExamplesTests(TestCasePlus):
""".split() """.split()
if torch.cuda.is_available(): if torch.cuda.is_available():
testargs += ["--gpus=1"] testargs += ["--gpus=1"]
if is_cuda_and_apex_avaliable(): if is_cuda_and_apex_available():
testargs.append("--fp16") testargs.append("--fp16")
with patch.object(sys, "argv", testargs): with patch.object(sys, "argv", testargs):
...@@ -195,7 +195,7 @@ class ExamplesTests(TestCasePlus): ...@@ -195,7 +195,7 @@ class ExamplesTests(TestCasePlus):
testargs = ["run_generation.py", "--prompt=Hello", "--length=10", "--seed=42"] testargs = ["run_generation.py", "--prompt=Hello", "--length=10", "--seed=42"]
if is_cuda_and_apex_avaliable(): if is_cuda_and_apex_available():
testargs.append("--fp16") testargs.append("--fp16")
model_type, model_name = ( model_type, model_name = (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment