lm-sys / lm-sys/FastChat

`TypeError: not a string` after pressing to special characters use delete

Open
#1,809 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
39.5k
Forks
4.8k
PR merge metrics
No merged PRs in 30d

Description

今天(2023年6月29日)星期几为星期四。
USER: 而且4月6号是 星期四   #  --> 是{ }星, here is not space, after pressing to special characters use delete, throws an error

│ py:316 in _EncodeAsPieces                                                                        │
│                                                                                                  │
│    313 │   │   return _sentencepiece.SentencePieceProcessor__EncodeAsIds(self, text, enable_sam  │
│    314 │                                                                                         │
│    315 │   def _EncodeAsPieces(self, text, enable_sampling, nbest_size, alpha, add_bos, add_eos  │
│ ❱  316 │   │   return _sentencepiece.SentencePieceProcessor__EncodeAsPieces(self, text, enable_  │
│    317 │                                                                                         │
│    318 │   def _EncodeAsSerializedProto(self, text, enable_sampling, nbest_size, alpha, add_bos  │
│    319 │   │   return _sentencepiece.SentencePieceProcessor__EncodeAsSerializedProto(self, text  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: not a string

After pressing to special characters use delete, throws an error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported deletion action with the provided Chinese text, then start at the _EncodeAsPieces call shown in the py:316 stack trace. Trace the value passed to SentencePiece and verify that deleting after special characters no longer raises TypeError: not a string.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.