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
e91692f4
Unverified
Commit
e91692f4
authored
Apr 03, 2020
by
ahotrod
Committed by
GitHub
Apr 03, 2020
Browse files
Update README.md (#3603)
parent
8e287d50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
22 deletions
+3
-22
model_cards/ahotrod/albert_xxlargev1_squad2_512/README.md
model_cards/ahotrod/albert_xxlargev1_squad2_512/README.md
+3
-22
No files found.
model_cards/ahotrod/albert_xxlargev1_squad2_512/README.md
View file @
e91692f4
...
@@ -64,27 +64,8 @@ TensorFlow: 2.1.0
...
@@ -64,27 +64,8 @@ TensorFlow: 2.1.0
Python: 3.7.6
Python: 3.7.6
```
```
### Inferencing / prediction works with the current Transformers v2.4.1
### Access this albert_xxlargev1_sqd2_512 fine-tuned model with:
### Access this albert_xxlargev1_sqd2_512 fine-tuned model with "tried & true" code:
```
python
```
python
config_class
,
model_class
,
tokenizer_class
=
\
tokenizer
=
AutoTokenizer
.
from_pretrained
(
"ahotrod/albert_xxlargev1_squad2_512"
)
AlbertConfig
,
AlbertForQuestionAnswering
,
AlbertTokenizer
model
=
AutoModelForQuestionAnswering
.
from_pretrained
(
"ahotrod/albert_xxlargev1_squad2_512"
)
model_name_or_path
=
"ahotrod/albert_xxlargev1_squad2_512"
config
=
config_class
.
from_pretrained
(
model_name_or_path
)
tokenizer
=
tokenizer_class
.
from_pretrained
(
model_name_or_path
,
do_lower_case
=
True
)
model
=
model_class
.
from_pretrained
(
model_name_or_path
,
config
=
config
)
```
### or the AutoModels (AutoConfig, AutoTokenizer & AutoModel) should also work, however I have yet to use them in my app & confirm:
```
python
from
transformers
import
AutoConfig
,
AutoTokenizer
,
AutoModel
model_name_or_path
=
"ahotrod/albert_xxlargev1_squad2_512"
config
=
AutoConfig
.
from_pretrained
(
model_name_or_path
)
tokenizer
=
AutoTokenizer
.
from_pretrained
(
model_name_or_path
,
do_lower_case
=
True
)
model
=
AutoModel
.
from_pretrained
(
model_name_or_path
,
config
=
config
)
```
\ No newline at end of file
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