Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When translating, the translation result will keep adding text. #81

Open
2 tasks done
codeAndxv opened this issue Oct 6, 2024 · 17 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@codeAndxv
Copy link

codeAndxv commented Oct 6, 2024

Thank you for wanting to report a bug! But before starting, ensure to check if this bug report respects the following requirements:

  • It is written in English (I can translate what you say, but issues written in English are easier to read for the other users).
  • There is not already a similar bug report among the open issues (if this is the case you can leave a comment describing your problem in more detail in that already opened issue)

Describe the bug
When I type "你好啊世界如何看待目前的经济局势失业很严重大家都找不到工作未来会变的好吗", it is translated from Chinese to English. The translation results will always append text, just like the one I took in the screenshot. I'm using the latest v2.0.0 commit code
,6bf51c1e2f70

Screenshots

Image 1 Image 3 Image 2

Smartphone (please complete the following information):

  • Device: xiaomi 12
  • Android OS version: Android 13
  • TTS used: No
  • Version of the app: 2.1.1

Additional context
Add any other context about the problem here.

@codeAndxv codeAndxv added the bug Something isn't working label Oct 6, 2024
@niedev
Copy link
Owner

niedev commented Oct 6, 2024

Thank you for reporting this bug, I will investigate on this.

@codeAndxv
Copy link
Author

codeAndxv commented Oct 13, 2024

Thank you for reporting this bug, I will investigate on this.

Hi, is this problem difficult to solve, and can you estimate how long it will take to resolve it? Because this issue occurs frequently, it's quite troublesome for me. Thanks! By the way, if you need help, I know some Java and Android.

@niedev
Copy link
Owner

niedev commented Oct 13, 2024

I did some testing and the problem seems to be due to the quantization of the models (and greater for Chinese), which would make it quite difficult to solve. However I tried adding a period at the end of the sentence that gave you problems and in that case the problem goes away. For now you could try to always add a period at the end of input sentences, let me know if this solves or reduces the problem, in that case I will make an update in which the app will automatically add a period at the end of sentences when needed.

Thanks again.

@codeAndxv
Copy link
Author

codeAndxv commented Oct 25, 2024

In addition to adding a full stop at the end, and forcibly breaking the entered text.

I tried to add the java code snapper below in this place. Without modifying the model, this problem can be solved.

if (j > 2 * input.getInputIDs().length) {
      android.util.Log.i("decoder", "Reach max tokenId count: " + 2 * input.getInputIDs().length + ", maybe occur error, break while.");
      break;
}

But the root cause is a model problem.

@niedev
Copy link
Owner

niedev commented Oct 26, 2024

@codeAndxv Thank you for your input, this would definitely help. I'll try this change and others next week (I started a new job so I don't have much time, but I should be able to get around to it).

@niedev
Copy link
Owner

niedev commented Nov 1, 2024

The new release that should mitigate this problem is out 🚀, let me know if the problem occurs less.

@codeAndxv
Copy link
Author

It look fine, Thanks.

@zhl111
Copy link

zhl111 commented Nov 3, 2024

SmartSelect_20241103_173748_RTranslator
After I said one sentence, everything turned gray and nothing clicked except the return key.

@niedev
Copy link
Owner

niedev commented Nov 3, 2024

@zhl111 have you tried RTranslator 2.1.2?

@zhl111
Copy link

zhl111 commented Nov 3, 2024

Yes, this is the version I use. My mobile phone is Samsung s23ultra, is it related to the system of the mobile phone?

@niedev
Copy link
Owner

niedev commented Nov 3, 2024

@zhl111 Ok, I don't think this is due to the system of the phone, but it can be due to the tts you use. Everything turn gray (and stay gray) after the transcription appear or before? And if you turn off the TTS (from the top right speaker button in the WalkieTalkie mode) the problem goes away?

@zhl111
Copy link

zhl111 commented Nov 4, 2024

It's all right

@niedev
Copy link
Owner

niedev commented Nov 4, 2024

@zhl111 what tts are you using?

@zhl111
Copy link

zhl111 commented Nov 5, 2024

google tts

@niedev
Copy link
Owner

niedev commented Nov 6, 2024

@zhl111 That's strange, when everything turn gray, it stay gray forever or it return green after the sentence is spoken?

@zhl111
Copy link

zhl111 commented Nov 8, 2024

Before, all the buttons were gray, now they turn green after the sentence is finished

@niedev
Copy link
Owner

niedev commented Nov 9, 2024

@zhl111 Ok, before the bug we discussed was the problem, now the app behaves normally. In WalkieTalkie mode while the app processes the translation and the tts speaks the microphone deactivates because otherwise, the app would recognize the audio of the tts, translating in a loop (the Conversation mode instead, using Bluetooth headphones, never interrupts the microphones because with headphones you obviously don't have this problem).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants