liyucheng09 / Selective_Context

Compress your input to ChatGPT or other LLMs, to let them process 2x more content and save 40% memory and GPU time.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confusion with the code

xxSpencer opened this issue · comments

This is a interesting work! I have some confusion that I need to ask for advice from you, dear author, and thank you for your time.
Basically, I have two question:
① In this funciton, why we need to add '[CLS]' before cope with the text?

def _get_self_info_via_baichuan(self, text: str) -> Tuple[List[str], List[float]]:
         text = f"[CLS]{text}"

Is this have something to do with the GPT2's or curie's tokenizer?
② What if I want to replace the LLMs with other models like Baichuan2, anything I have to notice?
Thanks for your patience and time again!

  1. Yes, the [CLS] is the bos token for GPT models, indicating the start of the input. Should be replaced if you use other models.
  2. The overall framework is flexible so feel free to try other models.
  1. Yes, the [CLS] is the bos token for GPT models, indicating the start of the input. Should be replaced if you use other models.
  2. The overall framework is flexible so feel free to try other models.

Thanks! Wish you all the best.