From 14deaf3bb0c0d34c5e34d16e007a2cffee151417 Mon Sep 17 00:00:00 2001 From: kpe Date: Mon, 6 Jan 2020 11:40:55 +0100 Subject: [PATCH] fixes #39 --- bert/tokenization/albert_tokenization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bert/tokenization/albert_tokenization.py b/bert/tokenization/albert_tokenization.py index 2d1676b..1077954 100644 --- a/bert/tokenization/albert_tokenization.py +++ b/bert/tokenization/albert_tokenization.py @@ -26,7 +26,6 @@ import six from six.moves import range import tensorflow.compat.v1 as tf -import tensorflow_hub as hub import sentencepiece as spm SPIECE_UNDERLINE = u"▁".encode("utf-8") @@ -258,6 +257,7 @@ def from_scratch(cls, vocab_file, do_lower_case, spm_model_file): @classmethod def from_hub_module(cls, hub_module, spm_model_file): """Get the vocab file and casing info from the Hub module.""" + import tensorflow_hub as hub with tf.Graph().as_default(): albert_module = hub.Module(hub_module) tokenization_info = albert_module(signature="tokenization_info",