Unverified Commit a293a0e8 authored by Joao Gante's avatar Joao Gante Committed by GitHub
Browse files

CLI: add import protection to datasets (#19470)

parent ae710425
...@@ -18,7 +18,6 @@ from argparse import ArgumentParser, Namespace ...@@ -18,7 +18,6 @@ from argparse import ArgumentParser, Namespace
from importlib import import_module from importlib import import_module
import numpy as np import numpy as np
from datasets import load_dataset
from packaging import version from packaging import version
import huggingface_hub import huggingface_hub
...@@ -31,6 +30,7 @@ from .. import ( ...@@ -31,6 +30,7 @@ from .. import (
AutoFeatureExtractor, AutoFeatureExtractor,
AutoProcessor, AutoProcessor,
AutoTokenizer, AutoTokenizer,
is_datasets_available,
is_tf_available, is_tf_available,
is_torch_available, is_torch_available,
) )
...@@ -46,6 +46,9 @@ if is_tf_available(): ...@@ -46,6 +46,9 @@ if is_tf_available():
if is_torch_available(): if is_torch_available():
import torch import torch
if is_datasets_available():
from datasets import load_dataset
MAX_ERROR = 5e-5 # larger error tolerance than in our internal tests, to avoid flaky user-facing errors MAX_ERROR = 5e-5 # larger error tolerance than in our internal tests, to avoid flaky user-facing errors
......
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