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
e184ad13
Commit
e184ad13
authored
Jan 15, 2020
by
Julien Chaumond
Browse files
Close #2392
parent
dfe012ad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
src/transformers/pipelines.py
src/transformers/pipelines.py
+4
-3
tests/test_pipelines.py
tests/test_pipelines.py
+4
-4
No files found.
src/transformers/pipelines.py
View file @
e184ad13
...
...
@@ -883,10 +883,10 @@ SUPPORTED_TASKS = {
"pt"
:
AutoModelForTokenClassification
if
is_torch_available
()
else
None
,
"default"
:
{
"model"
:
{
"pt"
:
"
https://s3.amazonaws.com/models.huggingface.co/bert
/bert-large-cased-finetuned-conll03-english
-pytorch_model.bin
"
,
"tf"
:
"
https://s3.amazonaws.com/models.huggingface.co/bert
/bert-large-cased-finetuned-conll03-english
-tf_model.h5
"
,
"pt"
:
"
dbmdz
/bert-large-cased-finetuned-conll03-english"
,
"tf"
:
"
dbmdz
/bert-large-cased-finetuned-conll03-english"
,
},
"config"
:
"
https://s3.amazonaws.com/models.huggingface.co/bert
/bert-large-cased-finetuned-conll03-english
-config.json
"
,
"config"
:
"
dbmdz
/bert-large-cased-finetuned-conll03-english"
,
"tokenizer"
:
"bert-large-cased"
,
},
},
...
...
@@ -925,6 +925,7 @@ def pipeline(
pipeline('sentiment-analysis')
pipeline('question-answering', model='distilbert-base-uncased-distilled-squad', tokenizer='bert-base-cased')
pipeline('ner', model=AutoModel.from_pretrained(...), tokenizer=AutoTokenizer.from_pretrained(...)
pipeline('ner', model='dbmdz/bert-large-cased-finetuned-conll03-english', tokenizer='bert-base-cased')
pipeline('ner', model='https://...pytorch-model.bin', config='https://...config.json', tokenizer='bert-base-cased')
"""
# Retrieve the task
...
...
tests/test_pipelines.py
View file @
e184ad13
...
...
@@ -21,16 +21,16 @@ TF_QA_FINETUNED_MODELS = {
TF_NER_FINETUNED_MODELS
=
{
(
"bert-base-cased"
,
"
https://s3.amazonaws.com/models.huggingface.co/bert
/bert-large-cased-finetuned-conll03-english
-tf_model.h5
"
,
"
https://s3.amazonaws.com/models.huggingface.co/bert
/bert-large-cased-finetuned-conll03-english
-config.json
"
,
"
dbmdz
/bert-large-cased-finetuned-conll03-english"
,
"
dbmdz
/bert-large-cased-finetuned-conll03-english"
,
)
}
NER_FINETUNED_MODELS
=
{
(
"bert-base-cased"
,
"
https://s3.amazonaws.com/models.huggingface.co/bert
/bert-large-cased-finetuned-conll03-english
-pytorch_model.bin
"
,
"
https://s3.amazonaws.com/models.huggingface.co/bert
/bert-large-cased-finetuned-conll03-english
-config.json
"
,
"
dbmdz
/bert-large-cased-finetuned-conll03-english"
,
"
dbmdz
/bert-large-cased-finetuned-conll03-english"
,
)
}
...
...
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