Unverified Commit 607d7da5 authored by Brian Vaughan's avatar Brian Vaughan Committed by GitHub
Browse files

fallback to classname when LM doesnt have config (#1334)

parent 5c25dd55
......@@ -158,11 +158,16 @@ def simple_evaluate(
)
if lm.rank == 0:
if isinstance(model, str):
model_name = model
elif hasattr(model, "config") and hasattr(model.config, "_name_or_path"):
model_name = model.config._name_or_path
else:
model_name = type(model).__name__
# add info about the model and few shot config
results["config"] = {
"model": model
if isinstance(model, str)
else model.model.config._name_or_path,
"model": model_name,
"model_args": model_args,
"batch_size": batch_size,
"batch_sizes": list(lm.batch_sizes.values())
......
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