Commit b2f6bce8 authored by Leo Gao's avatar Leo Gao
Browse files

Fix fewshot_context method handling

parent c3bec45f
...@@ -2,6 +2,7 @@ import os ...@@ -2,6 +2,7 @@ import os
import re import re
import collections import collections
import functools import functools
import inspect
class ExitCodeError(Exception): class ExitCodeError(Exception):
...@@ -148,7 +149,7 @@ def positional_deprecated(fn): ...@@ -148,7 +149,7 @@ def positional_deprecated(fn):
""" """
@functools.wraps(fn) @functools.wraps(fn)
def _wrapper(*args, **kwargs): def _wrapper(*args, **kwargs):
if len(args) != 0: if len(args) != 1 if inspect.ismethod(fn) else 0:
print(f"WARNING: using {fn.__name__} with positional arguments is " print(f"WARNING: using {fn.__name__} with positional arguments is "
"deprecated and will be disallowed in a future version of " "deprecated and will be disallowed in a future version of "
"lm-evaluation-harness!") "lm-evaluation-harness!")
......
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