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