Skip to content

Commit

Permalink
v0.2.6b4
Browse files Browse the repository at this point in the history
  • Loading branch information
wasertech committed Mar 11, 2023
1 parent 58f6e8e commit a8b1f65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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.6b3"
__version__ = "0.2.6b4"

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

from multiprocessing import Queue, Process
from threading import Thread
Expand Down Expand Up @@ -183,9 +184,13 @@ def main():
time_after = time.perf_counter()
_td = time_after - time_before
spinner.info(f"All files in {args.directory} have been translated from {_from} to {_to}.")
spinner.info(f"Took {_td:.1f} second(s) to translate over {_ut_ds >> 30} GB (~ {float(_ut_ds >> 27)/_td:.1f} Gb/s).")

if Path(cache).exists(): os.rmdir(cache)
_sgb = _ut_ds >> 30
if _sgb > 0:
spinner.info(f"Took {_td:.1f} second(s) to translate over {_sgb} GB (~ {float(_ut_ds >> 27)/_td:.1f} Gb/s).")
else:
spinner.info(f"Took {_td:.1f} second(s) to translate less than 1 GB.")

if Path(cache).exists(): shutil.rmtree(cache)

except UserWarning:
pass
Expand Down

0 comments on commit a8b1f65

Please sign in to comment.