Unverified Commit c5fc2b19 authored by Stella Biderman's avatar Stella Biderman Committed by GitHub
Browse files

Add Python 3.8 compatibility

parent 674cf52e
...@@ -229,7 +229,11 @@ def create_task_from_path(json_path): ...@@ -229,7 +229,11 @@ def create_task_from_path(json_path):
def create_all_tasks(): def create_all_tasks():
resources_dir = importlib.resources.files("lm_eval.datasets") / "bigbench_resources" try:
resources_dir = importlib.resources.files("lm_eval.datasets") / "bigbench_resources"
except:
import importlib_resources
resources_dir = importlib_resources.files("lm_eval.datasets") / "bigbench_resources"
supported_tasks = [os.path.splitext(x)[0] for x in os.listdir(resources_dir)] supported_tasks = [os.path.splitext(x)[0] for x in os.listdir(resources_dir)]
res = {} res = {}
for task_name in supported_tasks: for task_name in supported_tasks:
......
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