LibreChat icon indicating copy to clipboard operation
LibreChat copied to clipboard

[Bug]: Gemini: Garbled Characters in Chinese Outputs

Open Lawlietr opened this issue 1 year ago • 2 comments

What happened?

It well hannened ever time if i'm asking Gemini with Traditional Chinese.

Steps to Reproduce

This it's what the prompt i'm use:

You are a helpful assistant. 你是一個樂於助人的助手。請你提供專業、有邏輯、內容真實、有價值的詳細回,並以繁體中文台灣用語回覆。

And this it's a sample i'm asking for: 太陽能板是誰發明的

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Screenshots

11

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Lawlietr avatar Jan 22 '24 02:01 Lawlietr

Thanks for the report. This is a repeat of https://github.com/danny-avila/LibreChat/issues/1554

This is an issue with Google

see: https://github.com/danny-avila/LibreChat/discussions/1398#discussioncomment-7908029 and the related Google issue: https://github.com/google/generative-ai-js/issues/35

It was resolved on the latest google packages, but langchainjs has to bump their @google/generative-ai package.

I'll leave it open so I can remind myself to submit a ticket to langchainjs

danny-avila avatar Jan 22 '24 02:01 danny-avila

I've opened an issue: https://github.com/langchain-ai/langchainjs/issues/4113

danny-avila avatar Jan 22 '24 02:01 danny-avila

Addressed here: https://github.com/danny-avila/LibreChat/pull/1654

danny-avila avatar Jan 26 '24 21:01 danny-avila

The issue appears to remain unfixed

RedwindA avatar May 29 '24 10:05 RedwindA

The issue appears to remain unfixed

Can you give more details? Vertex or Generate AI API? If it's not fixed, it's for one and not the other, or dependent on the model.

danny-avila avatar May 29 '24 13:05 danny-avila

Seems to be Vertex AI, I'll look into it.

Generative AI API:

image

Vertex AI API:

image

danny-avila avatar May 29 '24 13:05 danny-avila

https://github.com/danny-avila/LibreChat/pull/2905 bumping versions was enough to fix this for Vertex

danny-avila avatar May 29 '24 14:05 danny-avila

I have similar symptoms with Cohere's Command R Plus. Should I create a separate new Issue?

haoblackj avatar May 30 '24 15:05 haoblackj

I have similar symptoms with Cohere's Command R Plus. Should I create a separate new Issue?

Seems related to a cohere issue here: https://github.com/cohere-ai/cohere-typescript/issues/151

I'll try it by updating their package, too.

danny-avila avatar May 30 '24 15:05 danny-avila

I have similar symptoms with Cohere's Command R Plus. Should I create a separate new Issue?

I can't reproduce the issue on the current build, how do you have cohere setup? what is your prompt?

danny-avila avatar May 30 '24 15:05 danny-avila

I have similar symptoms with Cohere's Command R Plus. Should I create a separate new Issue?

Seems related to a cohere issue here: cohere-ai/cohere-typescript#151

I'll try it by updating their package, too.

Can confirm [email protected] still has this issue.

lazydogP avatar May 30 '24 16:05 lazydogP

I have similar symptoms with Cohere's Command R Plus. Should I create a separate new Issue?

Seems related to a cohere issue here: cohere-ai/cohere-typescript#151 I'll try it by updating their package, too.

Can confirm [email protected] still has this issue.

I can't reproduce it, when and how are you seeing the issue?

image

danny-avila avatar May 30 '24 16:05 danny-avila

I can't reproduce it, when and how are you seeing the issue?

image

Prompt:

Write a story in Simplified Chinese in more than 3000 words.

20240531000417

lazydogP avatar May 30 '24 16:05 lazydogP

I see it seems to be at the end of the stream

danny-avila avatar May 30 '24 16:05 danny-avila

@lazydogP @haoblackj I have a quick workaround, seems we cannot rely on the stream-end event to avoid this issue

danny-avila avatar May 30 '24 16:05 danny-avila

I am typing the prompt in Japanese. It's true that long prompts often seem to cause garbled characters.

The most recent prompt that caused the phenomenon is this one.

Prompt: この日本語の文章を、表現豊かで洗練された文章になるよう修正しなさい。

Under this prompt, I'm giving a Japanese sentence of about 2000 characters.

Sorry, Cohere's API is limited and I don't know if the phenomenon still occurs (they say I use it too much).

haoblackj avatar May 30 '24 16:05 haoblackj