MaKTaiL / gemini-srt-translator

Python tool for translating subtitles using Google Gemini AI
https://pypi.org/project/gemini-srt-translator/
MIT License
8 stars 2 forks source link

Gemini has returned a different issue #3

Closed CevreMuhendisi closed 2 days ago

CevreMuhendisi commented 4 days ago

"Gemini has returned a different number of lines than the original , trying again" I'm getting this error, is there a solution for it?

image

MaKTaiL commented 4 days ago

What version are you using? This should be fixed in v1.1.4

CevreMuhendisi commented 4 days ago

im using 1.1.4 version. python version 3.11

image

image

MaKTaiL commented 3 days ago

Hi, seems to be a problem with how Gemini sometimes handles some dialogs (it decides to arbitrarily split some dialogs in two). I got a fix coming up in the next version with a workaround for this. Hopefully it will solve the problem for good.

ongnxco commented 2 days ago

I have the same problem and after updating gemini-srt-translator-1.2.0 a new error appeared.

Traceback (most recent call last):
  File "~/gemini-trans/main.py", line 1, in <module>
    import gemini_srt_translator as gst
  File "~/gemini-trans/.venv/lib/python3.11/site-packages/gemini_srt_translator/__init__.py", line 32, in <module>
    from .main import GeminiSRTTranslator
  File "~/gemini-trans/.venv/lib/python3.11/site-packages/gemini_srt_translator/main.py", line 159
    translated_subtitle[int(line["index"])].content = f"\u202B{line["content"]}\u202C"
                                                                     ^^^^^^^
SyntaxError: f-string: unmatched '['
MaKTaiL commented 2 days ago

@ongnxco this should be fixed now in version v1.2.1, sorry about that. ;)