Skip to content

Commit

Permalink
fix: update error handling in Translator class and remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
NULL204 committed Feb 6, 2025
1 parent e8501dd commit e199c12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion yuisub/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from yuisub.bangumi import BGM, bangumi # noqa: F401
from yuisub.llm import Summarizer, Translator # noqa: F401
from yuisub.prompt import ORIGIN, ZH # noqa: F401
from yuisub.prompt import ZH # noqa: F401
from yuisub.sub import advertisement, bilingual, load, translate # noqa: F401
from yuisub.translator import SubtitleTranslator # noqa: F401
4 changes: 2 additions & 2 deletions yuisub/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ async def ask(self, question: str) -> ZH:
raise e

except Exception as e:
print(f"Unknown Error: {e} return original question: {question.origin}")
return ZH(zh=question.origin)
print(f"Unknown Error: {e} return original question: {question}")
return ZH(zh=question)

return zh

Expand Down

0 comments on commit e199c12

Please sign in to comment.