Commit 4d3ea67a authored by Benjamin Fattori's avatar Benjamin Fattori
Browse files

fix warning issue if single device

parent 46f37ec0
...@@ -71,7 +71,7 @@ class HFLM(LM): ...@@ -71,7 +71,7 @@ class HFLM(LM):
# multigpu support with accelerate # multigpu support with accelerate
if gpus > 1: if gpus > 1:
accelerator = Accelerator(device_placement=False) accelerator = Accelerator(device_placement=False)
if gpus > self.accelerator.num_processes: if gpus > accelerator.num_processes:
warning = ("WARNING: The number of total GPUs does not match the number of spawned processes. " warning = ("WARNING: The number of total GPUs does not match the number of spawned processes. "
"If you would like to use data parallelism, please launch the script " "If you would like to use data parallelism, please launch the script "
"with 'accelerate launch *script*'. " "with 'accelerate launch *script*'. "
......
...@@ -57,7 +57,7 @@ def pattern_match(patterns, source_list): ...@@ -57,7 +57,7 @@ def pattern_match(patterns, source_list):
for pattern in patterns: for pattern in patterns:
for matching in fnmatch.filter(source_list, pattern): for matching in fnmatch.filter(source_list, pattern):
task_names.add(matching) task_names.add(matching)
return list(task_names) return sorted(list(task_names))
def main(): def main():
......
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