(chatrounds_list)
| 67 | |
| 68 | |
| 69 | def get_chatrounds_ids(chatrounds_list): |
| 70 | input_ids = [] |
| 71 | for chatround in chatrounds_list: |
| 72 | input_ids += tokenizer.encode(role_start + chatround["role"]+ role_end) + tokenizer.encode(chatround["content"], add_special_tokens=False) + [tokenizer.eos_token_id] |
| 73 | input_ids += tokenizer.encode(role_start + "bot" + role_end) |
| 74 | return input_ids |
| 75 | |
| 76 | class GetAssistantAns(): |
| 77 | # 按照自己推理需求自己修改代码 |