continue icon indicating copy to clipboard operation
continue copied to clipboard

Chat Interface Autocomplete Issues with Chinese Characters

Open ShaySheng opened this issue 1 year ago • 4 comments

I've noticed an issue with the rendering of Chinese characters in the chat interface. When Chinese text is generated, it doesn't appear visible on the frontend, despite being present in the backend response.

For example, when I input Chinese text, the response is generated but not displayed:

==========================================================================
==========================================================================
Settings:
contextLength: 1024
maxTokens: 512
temperature: 1
topP: 1
presencePenalty: 0
frequencyPenalty: 0
model: deepseek-chat
raw: true
stop: 
,
,/src/,#- coding: utf-8,```
log: undefined
############################################
验的误解和误用,正像我们时常误解和误用世界上许多其它东西一样。
因此()。
A. 我们应该取消测验
B. 使用测验能使我们解决生活中的一切难题
C. 还应不断地完善测验并引导人们正确地认识和使用测验
D. 测验是可有可无的东西
让我们来一步步==========================================================================
==========================================================================
Completion:
推理这个问题。

The frontend display looks like this:

截屏2024-09-07 12 17 23

However, when I input text in English, it appears immediately and correctly:

Criticism and even attacks against the use of tests are abundant. Sometimes, their use can even lead to unintended adverse consequences. The reasons for this situation lie not only in the imperfection of tests themselves, much like many other things in the world are imperfect, but more so in people's misunderstandings and misuse of tests, similar to how we often misunderstand and misuse many other things in the world.
Therefore, ().
A. we should abolish tests
B. using tests can solve all problems in our lives
C. tests should be continually improved and people should be guided to understand and use them correctly
D. tests are dispensable items
Let us ==========================================================================
==========================================================================
Completion:
analyze the options one by one:

The English text displays correctly:

截屏2024-09-07 12 19 09

Is it possible to fix this issue? Are there any other problems I might have overlooked that could be causing this?

Any assistance in resolving this would be greatly appreciated. Thank you!

ShaySheng avatar Sep 06 '24 22:09 ShaySheng

I've noticed that when I type in Chinese, the occurrence of autocompletion suggestions seems completely random. However, in English, there's a clear difference. The autocomplete suggestions pop up much more readily and predictably.

ShaySheng avatar Sep 07 '24 04:09 ShaySheng

Upon reviewing the logs, I discovered that the completions were indeed generated, so my question is: How can I ensure these generated responses are properly displayed on the frontend?

ShaySheng avatar Sep 07 '24 04:09 ShaySheng

Here is my tabAutocomplete setting:

  "tabAutocompleteModel": [
    {
      "title": "DeepSeek-Tabcomplete",
      "model": "deepseek-chat",
      "apiKey": "sk-xxxxxx",
      "contextLength": 1024,
      "apiBase": "https://api.deepseek.com/beta",
      "completionOptions": {
        "maxTokens": 512,
        "temperature": 1.0,
        "topP": 1,
        "presencePenalty": 0,
        "frequencyPenalty": 0
      },
      "provider": "openai"
    },
    {
      "title": "GPT-3.5-Turbo",
      "provider": "openai",
      "model": "gpt-3.5-turbo",
      "apiKey": "sk-xxxxxx",
      "apiBase": "https://www.gptapi.us/v1",
      "useLegacyCompletionsEndpoint": false
    }
  ],
  "tabAutocompleteOptions": {
    "disable": false,
    "useCopyBuffer": false,
    "useSuffix": false,
    "maxPromptTokens": 512,
    "prefixPercentage": 0.85,
    "maxSuffixPercentage": 0.25,
    "debounceDelay": 350,
    "multilineCompletions": "always",
    "slidingWindowPrefixPercentage": 0.75,
    "slidingWindowSize": 350,
    "maxSnippetPercentage": 0.3,
    "recentlyEditedSimilarityThreshold": 0.3,
    "useCache": true,
    "onlyMyCode": true,
    "useOtherFiles": false,
    "useRecentlyEdited": false,
    "recentLinePrefixMatchMinLength": 7,
    "disableInFiles": ["*.csv", "*.json"],
    "useFileSuffix": false,
    "template": "Continue the following text, making it flow naturally. Provide only your continuation content, without adding any explanations, formatting, or extra outputs. Ensure your response is relevant and non-empty.\n{{{prefix}}}"
  },

ShaySheng avatar Sep 07 '24 07:09 ShaySheng

I encountered the same issue! The auto-completion of Chinese characters may or may not appear on the code editing page, but the backend indicates that the final result has been generated.

jijiamoer avatar Sep 09 '24 14:09 jijiamoer

This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.

github-actions[bot] avatar Mar 03 '25 04:03 github-actions[bot]

This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!

github-actions[bot] avatar Mar 16 '25 02:03 github-actions[bot]