Skip to content

[feature] add chatglm3-6b-32k support #207

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

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

ChieloNewctle
Copy link
Contributor

@ChieloNewctle ChieloNewctle commented Nov 10, 2023

@ChieloNewctle
Copy link
Contributor Author

ChieloNewctle commented Nov 10, 2023

Please use the fast tokenizer from THUDM/chatglm3-6b PR #12.

@ChieloNewctle
Copy link
Contributor Author

Showcase

  • LightLLM arguments:

    python -m lightllm.server.api_server \
      --model_dir <model_dir> \
      --tp=1 --max_total_token_num 128000 \
      --max_req_input_len 15000 --max_req_total_len 16384 \
      --trust_remote_code --tokenizer_mode auto
  • Requesting:

    # generated from `ChatGLMTokenizerFast.build_chat_text`
    content = "<|user|><!encode-sep!>{'username': 'Chielo'}\n<!encode-sep!>这是什么语言?“aburaka    dabura   ”<|assistant|><!encode-sep!>\n<!encode-sep!>这是来自外星的语言。<|user|><!encode-sep!>\n<!encode-sep!>是哪个星球的呢?<|assistant|>"
    requests.post('http://localhost:8000/generate', json={
        'inputs': content,
        'parameters': { "max_new_tokens": 64 },
    }).json()
  • chatglm3-6b:

    {'generated_text': ['\n 很抱歉,我并不知道这是来自哪个星球的语言,因为这是一个虚构的外星语言。 </s>'],
     'count_output_tokens': 23}
  • chatglm3-6b-32k:

    {'generated_text': ['\n 抱歉,我是一个人工智能助手,我并不知道外星语言的具体信息。 </s>'],
     'count_output_tokens': 19}

@ChieloNewctle
Copy link
Contributor Author

Evaluation

HumanEval

Model pass@1
chatglm3-6b 61.59%
chatglm3-6b-32k 28.66%

@hiworldwzj hiworldwzj merged commit 5243a82 into ModelTC:main Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants