Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
a293a0e8
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "6c08840628a22a4d53ae563d1041479649d1a8e7"
Unverified
Commit
a293a0e8
authored
Oct 11, 2022
by
Joao Gante
Committed by
GitHub
Oct 11, 2022
Browse files
CLI: add import protection to datasets (#19470)
parent
ae710425
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/transformers/commands/pt_to_tf.py
src/transformers/commands/pt_to_tf.py
+4
-1
No files found.
src/transformers/commands/pt_to_tf.py
View file @
a293a0e8
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment