Skip to content

Commit

Permalink
import datasets only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlaix committed Nov 15, 2024
1 parent d9e9e4a commit ee90d06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/utils/test_task_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from unittest import TestCase

import pytest
from datasets import DatasetDict
from transformers import AutoConfig, AutoFeatureExtractor, AutoTokenizer

from optimum.utils.import_utils import is_datasets_available
from optimum.utils.preprocessing import TaskProcessorsManager
from optimum.utils.testing_utils import require_datasets

Expand All @@ -31,6 +31,9 @@
from transformers import PretrainedConfig, PreTrainedTokenizerBase
from transformers.image_processing_utils import BaseImageProcessor

if is_datasets_available():
from datasets import DatasetDict


TEXT_MODEL_NAME = "bert-base-uncased"
CONFIG = AutoConfig.from_pretrained(TEXT_MODEL_NAME)
Expand Down

0 comments on commit ee90d06

Please sign in to comment.