Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion seq2seq/data/vocab.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ def create_vocabulary_lookup_table(filename, default_value=None):

has_counts = len(vocab[0].split("\t")) == 2
if has_counts:
vocab, counts = zip(*[_.split("\t") for _ in vocab])
pairs = [["\t", line.split("\t")[-1]]
if line.startswith("\t\t") else line.split("\t")
for line in vocab]
vocab, counts = zip(*pairs)
counts = [float(_) for _ in counts]
vocab = list(vocab)
else:
Expand Down
2 changes: 1 addition & 1 deletion seq2seq/test/hooks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_begin(self):
with gfile.GFile(os.path.join(model_dir, "model_analysis.txt")) as file:
file_contents = file.read().strip()

self.assertEqual(file_contents.decode(), "_TFProfRoot (--/16.38k params)\n"
self.assertEqual(file_contents, "_TFProfRoot (--/16.38k params)\n"
" weigths (128x128, 16.38k/16.38k params)")
outfile.close()

Expand Down