Skip to content

Commit

Permalink
Fixed bug of import url_to_fs from fsspec (#507) (#512)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
LoserCheems and clefourrier authored Jan 24, 2025
1 parent 0ab63d0 commit 4f381b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lighteval/logging/evaluation_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import torch
from datasets import Dataset, load_dataset
from datasets.utils.metadata import MetadataConfigs
from fsspec import url_to_fs
from huggingface_hub import DatasetCard, DatasetCardData, HfApi, HFSummaryWriter, hf_hub_url

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

try:
from fsspec import url_to_fs
except ImportError:
from fsspec.core import url_to_fs


class EnhancedJSONEncoder(json.JSONEncoder):
"""
Expand Down

0 comments on commit 4f381b3

Please sign in to comment.