Skip to content

Commit 4f381b3

Browse files
Fixed bug of import url_to_fs from fsspec (#507) (#512)
* Fixed bug of import url_to_fs from fsspec (#507) * Add a try catch as import depend on fsspec version * Fixed code quality --------- Co-authored-by: Clémentine Fourrier <22726840+clefourrier@users.noreply.github.com>
1 parent 0ab63d0 commit 4f381b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lighteval/logging/evaluation_tracker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import torch
3535
from datasets import Dataset, load_dataset
3636
from datasets.utils.metadata import MetadataConfigs
37-
from fsspec import url_to_fs
3837
from huggingface_hub import DatasetCard, DatasetCardData, HfApi, HFSummaryWriter, hf_hub_url
3938

4039
from lighteval.logging.info_loggers import (
@@ -53,6 +52,11 @@
5352
if is_nanotron_available():
5453
from nanotron.config import GeneralArgs # type: ignore
5554

55+
try:
56+
from fsspec import url_to_fs
57+
except ImportError:
58+
from fsspec.core import url_to_fs
59+
5660

5761
class EnhancedJSONEncoder(json.JSONEncoder):
5862
"""

0 commit comments

Comments
 (0)