mirror of
https://github.com/yihong0618/bilingual_book_maker.git
synced 2025-06-06 11:35:49 +00:00
Add some color on the translated text output (#226)
This commit is contained in:
parent
fd5782513a
commit
cc64495d90
@ -2,6 +2,7 @@ import re
|
|||||||
import time
|
import time
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from os import environ
|
from os import environ
|
||||||
|
from rich import print
|
||||||
|
|
||||||
import openai
|
import openai
|
||||||
|
|
||||||
@ -133,7 +134,7 @@ The total token is too long and cannot be completely translated\n
|
|||||||
|
|
||||||
# todo: Determine whether to print according to the cli option
|
# todo: Determine whether to print according to the cli option
|
||||||
if needprint:
|
if needprint:
|
||||||
print(re.sub("\n{3,}", "\n\n", t_text))
|
print("[bold green]" + re.sub("\n{3,}", "\n\n", t_text) + "[/bold green]")
|
||||||
|
|
||||||
time.time() - start_time
|
time.time() - start_time
|
||||||
# print(f"translation time: {elapsed_time:.1f}s")
|
# print(f"translation time: {elapsed_time:.1f}s")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user