Skip to content

Commit

Permalink
v0.2.6b2
Browse files Browse the repository at this point in the history
  • Loading branch information
wasertech committed Mar 11, 2023
1 parent e1c1a40 commit 217b671
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion translator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from translator.translate import Translator
from translator.language import get_nllb_lang

__version__ = "0.2.5b2"
__version__ = "0.2.6b2"

LANGS = get_nllb_lang()
7 changes: 5 additions & 2 deletions translator/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os, sys, psutil, time
import locale
import datetime

from multiprocessing import Queue, Process
from threading import Thread
Expand Down Expand Up @@ -154,7 +155,7 @@ def main():
time_before_3 = time.perf_counter()
spinner.info("Translating untranslated sentences...")
spinner.start()
spinner.text = f"[0/{_ut_ds:n} (0%) | 0 sentences / second]"
spinner.text = f"Processing first batch of {batch_size} sentences ({_ut_ds:n} total)... please wait for statistics."
_i, _t = 0, 0

for batch in untranslated_dataset.iter(batch_size):
Expand All @@ -165,7 +166,9 @@ def main():
time_meanwhile = time.perf_counter()
_td = time_meanwhile - _t
_i += batch_size
spinner.text = f"[{_i:n}/{_ut_ds:n} ({_i/_ut_ds:.2%}) | ~{batch_size/_td:.2f} sentences / second]"
_avg = batch_size/_td
_eta = (_ut_ds - _i) / _avg
spinner.text = f"[{_i:n}/{_ut_ds:n} ({_i/_ut_ds:.2%}) | ~{_avg:.2f} sentences / second | ETA : {datetime.timedelta(seconds=_eta)}]"

time_after_3 = time.perf_counter()
_td_3 = time_after_3 - time_before_3
Expand Down

0 comments on commit 217b671

Please sign in to comment.