voidpenguin-28 / Textractor-ExtraExtensions

Several useful Textractor extensions, which are not available by default in Textractor.
9 stars 1 forks source link

Gemini API Duplicated Translations #4

Closed voidpenguin-28 closed 1 month ago

voidpenguin-28 commented 1 month ago

Sir @voidpenguin-28 I'm using Gemini and it's working thanks to your instructions however, the translation is duplicating

image

How do I fix this?

Issue reported by @hotdogman1234 in the Textractor GPT thread.

voidpenguin-28 commented 1 month ago

@hotdogman1234

Can you provide the following information:

  1. What model are you using?
  2. Can you enable DebugMode for the extension and submit your "gpt-request-log.txt" once the issue has occurred at least one time while this mode is on?

My initial theory is that it might be Gemini itself being the problem here (the API returning the translation twice).

hotdogman1234 commented 1 month ago

Hi Sir Penguin,

I'm using gemini 1.5 flash just like you recommended

As for the debug mode, I don't know how to do that.

The double translation is only appearing on the main app, in the screenshot I provided, but in a separate window, it's only showing the translation once

voidpenguin-28 commented 1 month ago

DebugMode can be enabled by opening Textractor.ini in a text editor. Then in the settings for the extension, set DebugMode=1.

This will make all API request data log to gpt-request-log.txt.

This will help me narrow down the root cause.

On Thu, Oct 3, 2024, 9:47 AM hotdogman1234 @.***> wrote:

Hi Sir Penguin,

I'm using gemini 1.5 flash just like you recommended

As for the debug mode, I don't know how to do that.

The double translation is only appearing on the main app, in the screenshot I provided, but in a separate window, it's only showing the translation once

— Reply to this email directly, view it on GitHub https://github.com/voidpenguin-28/Textractor-ExtraExtensions/issues/4#issuecomment-2391470398, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFGCGD2VFLYLM7Z2JKRRHVDZZVDGDAVCNFSM6AAAAABPJWHZOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJRGQ3TAMZZHA . You are receiving this because you authored the thread.Message ID: @.***>

hotdogman1234 commented 1 month ago

gpt-request-log.txt

Hi again sir voidpenguin-28

The incident appeared again. I uploaded the log as you've requested

Thanks!

voidpenguin-28 commented 1 month ago

Thank you. I have a few more questions.

  1. Can you let me know which line of text repeated twice (of the lines that were logged)?
  2. Are you using the latest version of the GptApiTranslate extension?
  3. Would you be able to provide a screenshot of your current Textractor extension list?
hotdogman1234 commented 1 month ago

1) Any of the lines repeat after the initial translation. Its very first translation will produce a normal result, the subsequent texts are doubled

2) Yes, I'm using the latest model

3) Sure. image

hotdogman1234 commented 1 month ago

I don't know where to find the remove repeated phrases 2 extension, I would like to add it as well

voidpenguin-28 commented 1 month ago

Ah, it's likely your extension list causing these problems. A few problems there:

  1. You are using 2 different translation extensions, GptApiTranslate and Google Translate. You should only have one translation extension. If you are using the GptApiTranslate extension, then you should remove the Google Translate extension.
  2. The translation cache extensions are in the wrong order. "TranslationCache.Read" should be before GptApiTranslate.

Therefore, you should update your extension list to the following: Remove Repeated Characters Regex Filter Copy to Clipboard Textractor.VndbCharNameMapper Textractor.TranslationCache.Read Textractor.GptApiTranslate Textractor.TranslationCache.Write Extra Window Extra Newlines

As for "Remove Repeated Phrases 2", that extension should be in the root directory of Textractor: image

hotdogman1234 commented 1 month ago

I have updated the extensions order but now the english translation has disappeared

image image gpt-request-log.txt

voidpenguin-28 commented 1 month ago

Here are two things to try out.

  1. The extension order issues may have resulted in the translation cache being messed up. Try deleting the cache file "Textractor.TranslationCache.txt" (you may need to close Textractor first), then try testing again. image
  2. If the 1st step doesn't work, trying removing the "Textractor.TranslationCache.Read" and "Textractor.TranslationCache.Write" extensions and then try testing again.
hotdogman1234 commented 1 month ago

Thanks sir. It's working again now. I need to learn how to use the Name Mapper next because the translated names are wrong haha. Thanks a lot for all your help. I appreciate it. You're awesome!

voidpenguin-28 commented 1 month ago

Glad to help :)

As for the name mapping extension, you have to assign the VnId (from vndb) of the associated visual novel. For example, if you are reading "Clannad", the vndb link for Clannad is: https://vndb.org/v4

The 'v4' part of the url is the VnId of the visual novel.

Therefore, you would open up the Textractor.ini file, go to the [Textractor.VndbCharNameMapper] section, and under the 'VnIds' config value you would assign "VnIds=v4". Then the character names for Clannad would be mapped automatically.

hotdogman1234 commented 1 month ago

AMAZING!!!! I was reading your tutorial on it but I got confused. Now I know it's that simple!