mirror of
https://github.com/yihong0618/bilingual_book_maker.git
synced 2025-06-02 09:30:24 +00:00
fix: Modify log location and regular expressions
This commit is contained in:
parent
c28ae78119
commit
413810e2bf
@ -86,7 +86,7 @@ class ChatGPTAPI(Base):
|
||||
t_text = choice.get("message").get("content").encode("utf8").decode()
|
||||
|
||||
if choice["finish_reason"] == "length":
|
||||
with open("long_text.txt", "a") as f:
|
||||
with open("log/long_text.txt", "a") as f:
|
||||
print(
|
||||
f"""==================================================
|
||||
The total token is too long and cannot be completely translated\n
|
||||
@ -245,5 +245,5 @@ The total token is too long and cannot be completely translated\n
|
||||
self.log_translation_mismatch(plist_len, result_list, new_str, sep, log_path)
|
||||
|
||||
# del (num), num. sometime (num) will translated to num.
|
||||
result_list = [re.sub(r"^(\(\d+\)|\d+\.)\s*", "", s) for s in result_list]
|
||||
result_list = [re.sub(r"^(\(\d+\)|\d+\.|(\d+))\s*", "", s) for s in result_list]
|
||||
return result_list
|
||||
|
Loading…
x
Reference in New Issue
Block a user