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
a0a3e2f4
Unverified
Commit
a0a3e2f4
authored
Jul 10, 2024
by
Noah Young
Committed by
GitHub
Jul 10, 2024
Browse files
Fix file type checks in data splits for contrastive training example script (#31720)
fix data split file type checks
parent
e9eeedaf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
examples/pytorch/contrastive-image-text/run_clip.py
examples/pytorch/contrastive-image-text/run_clip.py
+3
-3
examples/tensorflow/contrastive-image-text/run_clip.py
examples/tensorflow/contrastive-image-text/run_clip.py
+3
-3
No files found.
examples/pytorch/contrastive-image-text/run_clip.py
View file @
a0a3e2f4
...
...
@@ -190,9 +190,9 @@ class DataTrainingArguments:
if
self
.
validation_file
is
not
None
:
extension
=
self
.
validation_file
.
split
(
"."
)[
-
1
]
assert
extension
in
[
"csv"
,
"json"
],
"`validation_file` should be a csv or a json file."
if
self
.
validation
_file
is
not
None
:
extension
=
self
.
validation
_file
.
split
(
"."
)[
-
1
]
assert
extension
==
"json"
,
"`
validation
_file` should be a json file."
if
self
.
test
_file
is
not
None
:
extension
=
self
.
test
_file
.
split
(
"."
)[
-
1
]
assert
extension
in
[
"csv"
,
"json"
]
,
"`
test
_file` should be a
csv or a
json file."
dataset_name_mapping
=
{
...
...
examples/tensorflow/contrastive-image-text/run_clip.py
View file @
a0a3e2f4
...
...
@@ -196,9 +196,9 @@ class DataTrainingArguments:
if
self
.
validation_file
is
not
None
:
extension
=
self
.
validation_file
.
split
(
"."
)[
-
1
]
assert
extension
in
[
"csv"
,
"json"
],
"`validation_file` should be a csv or a json file."
if
self
.
validation
_file
is
not
None
:
extension
=
self
.
validation
_file
.
split
(
"."
)[
-
1
]
assert
extension
==
"json"
,
"`
validation
_file` should be a json file."
if
self
.
test
_file
is
not
None
:
extension
=
self
.
test
_file
.
split
(
"."
)[
-
1
]
assert
extension
in
[
"csv"
,
"json"
]
,
"`
test
_file` should be a
csv or a
json file."
dataset_name_mapping
=
{
...
...
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