@@ -273,8 +273,8 @@ class Vocabulary(object):
273273
274274 def __init__ (self , vocab_file , start_word = "<S>" , end_word = "</S>" , unk_word = "<UNK>" , pad_word = "<PAD>" ):
275275 if not tf .gfile .Exists (vocab_file ):
276- tf .logging .fatal ("Vocab file %s not found." % vocab_file )
277- tf .logging .info ("Initializing vocabulary from file: %s" % vocab_file )
276+ tl .logging .fatal ("Vocab file %s not found." % vocab_file )
277+ tl .logging .info ("Initializing vocabulary from file: %s" % vocab_file )
278278
279279 with tf .gfile .GFile (vocab_file , mode = "r" ) as f :
280280 reverse_vocab = list (f .readlines ())
@@ -294,7 +294,7 @@ def __init__(self, vocab_file, start_word="<S>", end_word="</S>", unk_word="<UNK
294294
295295 logging .info ("Vocabulary from %s : %s %s %s" % (vocab_file , start_word , end_word , unk_word ))
296296 logging .info (" vocabulary with %d words (includes start_word, end_word, unk_word)" % len (vocab ))
297- # tf .logging.info(" vocabulary with %d words" % len(vocab))
297+ # tl .logging.info(" vocabulary with %d words" % len(vocab))
298298
299299 self .vocab = vocab # vocab[word] = id
300300 self .reverse_vocab = reverse_vocab # reverse_vocab[id] = word
@@ -1094,7 +1094,7 @@ def moses_multi_bleu(hypotheses, references, lowercase=False):
10941094 )
10951095 os .chmod (multi_bleu_path , 0o755 )
10961096 except Exception : # pylint: disable=W0702
1097- tf .logging .info ("Unable to fetch multi-bleu.perl script, using local." )
1097+ tl .logging .info ("Unable to fetch multi-bleu.perl script, using local." )
10981098 metrics_dir = os .path .dirname (os .path .realpath (__file__ ))
10991099 bin_dir = os .path .abspath (os .path .join (metrics_dir , ".." , ".." , "bin" ))
11001100 multi_bleu_path = os .path .join (bin_dir , "tools/multi-bleu.perl" )
@@ -1122,8 +1122,8 @@ def moses_multi_bleu(hypotheses, references, lowercase=False):
11221122 bleu_score = float (bleu_score )
11231123 except subprocess .CalledProcessError as error :
11241124 if error .output is not None :
1125- tf .logging .warning ("multi-bleu.perl script returned non-zero exit code" )
1126- tf .logging .warning (error .output )
1125+ tl .logging .warning ("multi-bleu.perl script returned non-zero exit code" )
1126+ tl .logging .warning (error .output )
11271127 bleu_score = np .float32 (0.0 )
11281128
11291129 # Close temp files
0 commit comments