Skip to content

Commit

Permalink
Merge pull request #469 from xinzhel/allennlp_doc
Browse files Browse the repository at this point in the history
fix bugs in doc for "Attacking Allennlp Models"
  • Loading branch information
qiyanjun committed Jul 16, 2021
2 parents 2ebbab0 + b3b36b4 commit 8918e8f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/2notebook/Example_2_allennlp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
"\n",
"class AllenNLPModel(textattack.models.wrappers.ModelWrapper):\n",
" def __init__(self):\n",
" self.model = Predictor.from_path(\"https://storage.googleapis.com/allennlp-public-models/basic_stanford_sentiment_treebank-2020.06.09.tar.gz\")\n",
" self.predictor = Predictor.from_path(\"https://storage.googleapis.com/allennlp-public-models/basic_stanford_sentiment_treebank-2020.06.09.tar.gz\")\n",
" self.model = self.predictor._model\n",
" self.tokenizer = self.predictor._dataset_reader._tokenizer\n",
"\n",
" def __call__(self, text_input_list):\n",
" outputs = []\n",
Expand Down Expand Up @@ -342,9 +344,8 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"name": "python379jvsc74a57bd00aa23297d40f12761ebb1c384bf2965d5ecbdef2f9c005ee7346b9ec0bcc5588",
"display_name": "Python 3.7.9 64-bit ('pytorch-gpu': pyenv)"
},
"language_info": {
"codemirror_mode": {
Expand Down

0 comments on commit 8918e8f

Please sign in to comment.