"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "866df66fe4a3b3b948b926d849ef291675b8a24c"
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
from importlib import import_module
import numpy as np
from datasets import load_dataset
from packaging import version
import huggingface_hub
......@@ -31,6 +30,7 @@ from .. import (
AutoFeatureExtractor,
AutoProcessor,
AutoTokenizer,
is_datasets_available,
is_tf_available,
is_torch_available,
)
......@@ -46,6 +46,9 @@ if is_tf_available():
if is_torch_available():
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
......
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