Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
DeprecationWarning removed for op-level token_embedders (#2955)
Browse files Browse the repository at this point in the history
* DeprecationWarning removed for op-level token_embedders

* removed test for DeprecationWarning

* removed old_embedder in test

* removed unused warning import

* added old_embedded to test

* Update basic_text_field_embedder_test.py

* Update basic_text_field_embedder_test.py
  • Loading branch information
pidugusundeep authored and matt-gardner committed Jun 18, 2019
1 parent a655ad5 commit 0f1bc3b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
@@ -1,4 +1,3 @@
import warnings
from typing import Dict, List, Union, Any
import inspect

Expand Down Expand Up @@ -162,11 +161,6 @@ def from_params(cls, vocab: Vocabulary, params: Params) -> 'BasicTextFieldEmbedd
}

else:
# Warn that the original behavior is deprecated
warnings.warn(DeprecationWarning("the token embedders for BasicTextFieldEmbedder should now "
"be specified as a dict under the 'token_embedders' key, "
"not as top-level key-value pairs"))

token_embedders = {}
keys = list(params.keys())
for key in keys:
Expand Down
Expand Up @@ -212,8 +212,7 @@ def test_old_from_params_new_from_params(self):
})

# Allow loading the parameters in the old format
with pytest.warns(DeprecationWarning):
old_embedder = BasicTextFieldEmbedder.from_params(params=old_params, vocab=self.vocab)
old_embedder = BasicTextFieldEmbedder.from_params(params=old_params, vocab=self.vocab)

new_params = Params({
"token_embedders": {
Expand Down

0 comments on commit 0f1bc3b

Please sign in to comment.