Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
f2a1e3ca
Unverified
Commit
f2a1e3ca
authored
Jul 22, 2024
by
Lucain
Committed by
GitHub
Jul 22, 2024
Browse files
Mention model_info.id instead of model_info.modelId (#32106)
parent
0fcfc5cc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
docs/source/en/model_doc/marian.md
docs/source/en/model_doc/marian.md
+1
-1
src/transformers/models/marian/convert_marian_to_pytorch.py
src/transformers/models/marian/convert_marian_to_pytorch.py
+1
-1
tests/models/marian/test_modeling_marian.py
tests/models/marian/test_modeling_marian.py
+1
-1
utils/update_tiny_models.py
utils/update_tiny_models.py
+1
-1
No files found.
docs/source/en/model_doc/marian.md
View file @
f2a1e3ca
...
...
@@ -105,7 +105,7 @@ from huggingface_hub import list_models
model_list
=
list_models
()
org
=
"Helsinki-NLP"
model_ids
=
[
x
.
modelI
d
for
x
in
model_list
if
x
.
modelI
d
.
startswith
(
org
)]
model_ids
=
[
x
.
i
d
for
x
in
model_list
if
x
.
i
d
.
startswith
(
org
)]
suffix
=
[
x
.
split
(
"/"
)[
1
]
for
x
in
model_ids
]
old_style_multi_models
=
[
f
"
{
org
}
/
{
s
}
"
for
s
in
suffix
if
s
!=
s
.
lower
()]
```
...
...
src/transformers/models/marian/convert_marian_to_pytorch.py
View file @
f2a1e3ca
...
...
@@ -65,7 +65,7 @@ def find_pretrained_model(src_lang: str, tgt_lang: str) -> List[str]:
"""Find models that can accept src_lang as input and return tgt_lang as output."""
prefix
=
"Helsinki-NLP/opus-mt-"
model_list
=
list_models
()
model_ids
=
[
x
.
modelI
d
for
x
in
model_list
if
x
.
modelI
d
.
startswith
(
"Helsinki-NLP"
)]
model_ids
=
[
x
.
i
d
for
x
in
model_list
if
x
.
i
d
.
startswith
(
"Helsinki-NLP"
)]
src_and_targ
=
[
remove_prefix
(
m
,
prefix
).
lower
().
split
(
"-"
)
for
m
in
model_ids
if
"+"
not
in
m
]
# + cant be loaded.
...
...
tests/models/marian/test_modeling_marian.py
View file @
f2a1e3ca
...
...
@@ -409,7 +409,7 @@ class ModelManagementTests(unittest.TestCase):
@
require_torch
def
test_model_names
(
self
):
model_list
=
list_models
()
model_ids
=
[
x
.
modelI
d
for
x
in
model_list
if
x
.
modelI
d
.
startswith
(
ORG_NAME
)]
model_ids
=
[
x
.
i
d
for
x
in
model_list
if
x
.
i
d
.
startswith
(
ORG_NAME
)]
bad_model_ids
=
[
mid
for
mid
in
model_ids
if
"+"
in
model_ids
]
self
.
assertListEqual
([],
bad_model_ids
)
self
.
assertGreater
(
len
(
model_ids
),
500
)
...
...
utils/update_tiny_models.py
View file @
f2a1e3ca
...
...
@@ -94,7 +94,7 @@ def get_tiny_model_summary_from_hub(output_path):
)
_models
=
set
()
for
x
in
models
:
model
=
x
.
modelI
d
model
=
x
.
i
d
org
,
model
=
model
.
split
(
"/"
)
if
not
model
.
startswith
(
"tiny-random-"
):
continue
...
...
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