Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion megatron/fused_kernels/tests/test_fused_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def test_layer_norm():
transformers.logging.FATAL,
)

except:
except Exception:
print("\n[Fail] Please install `transformers` package to test fused kernels\n")
exit(-1)

Expand Down
2 changes: 1 addition & 1 deletion megatron/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def set_verbosity_transformers(logging_level: str):
from transformers.utils import logging as transformers_logging
log_level = logging.log_levels[logging_level]
logging.set_verbosity(log_level)
except:
except Exception:
pass

if args.rank == 0:
Expand Down
4 changes: 2 additions & 2 deletions megatron/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
try:
import torch
_torch_available = True
except:
except Exception:
_torch_available = False

def is_torch_available():
Expand Down Expand Up @@ -312,7 +312,7 @@ def apply_print_resets(buf):
def assert_screenout(out, what):
out_pr = apply_print_resets(out).lower()
match_str = out_pr.find(what.lower())
assert match_str != -1, f"expecting to find {what} in output: f{out_pr}"
assert match_str != -1, f"expecting to find {what} in output: {out_pr}"


class CaptureStd:
Expand Down
2 changes: 1 addition & 1 deletion tools/merge_mp_partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def get_model(model_type):
from pretrain_gpt import model_provider
elif model_type == 'RACE':
from tasks.race.finetune import model_provider
elif model_type == ['MNLI', 'QQP']:
elif model_type in ['MNLI', 'QQP']:
num_classes = 2
if model_type == 'MNLI':
num_classes = 3
Expand Down