Skip to content

Commit 3bff35e

Browse files
committed
batching test
1 parent e52f7d1 commit 3bff35e

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/python/test_translate.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ def encode(line, sp):
1515
def decode(line, sp):
1616
return sp.Decode(line.split(" "))
1717

18+
input = []
1819
for line in sys.stdin:
19-
input = encode(line, sp_src)
20-
output = marian.translate(input) # synchronous line-by-line call
21-
print(decode(output, sp_trg))
20+
input.append(encode(line, sp_src))
21+
input = "\n".join(input)
22+
23+
output = marian.translate(input)
24+
25+
output = output.split("\n")
26+
for line in output:
27+
print(decode(line, sp_trg))

0 commit comments

Comments
 (0)