From 1ac6a246d8181fb53b0faea3c5b2d2578429f761 Mon Sep 17 00:00:00 2001 From: ahotrod <44321615+ahotrod@users.noreply.github.com> Date: Fri, 3 Apr 2020 06:28:25 -0700 Subject: [PATCH] Update README.md (#3604) Update AutoModel & AutoTokernizer loading. --- .../ahotrod/xlnet_large_squad2_512/README.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/model_cards/ahotrod/xlnet_large_squad2_512/README.md b/model_cards/ahotrod/xlnet_large_squad2_512/README.md index f2850032ec..a680704af1 100644 --- a/model_cards/ahotrod/xlnet_large_squad2_512/README.md +++ b/model_cards/ahotrod/xlnet_large_squad2_512/README.md @@ -56,22 +56,8 @@ PyTorch: 1.4.0 TensorFlow: 2.1.0 Python: 3.7.6 ``` -### Inferencing / prediction works with Transformers v2.4.1, the latest version tested - ### Utilize this xlnet_large_squad2_512 fine-tuned model with: ```python -config_class, model_class, tokenizer_class = \ - XLNetConfig, XLNetforQuestionAnswering, XLNetTokenizer -model_name_or_path = "ahotrod/xlnet_large_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 apps & confirm: -```python -from transformers import AutoConfig, AutoTokenizer, AutoModel -model_name_or_path = "ahotrod/xlnet_large_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) +tokenizer = AutoTokenizer.from_pretrained("ahotrod/xlnet_large_squad2_512") +model = AutoModelForQuestionAnswering.from_pretrained("ahotrod/xlnet_large_squad2_512") ```