LightRAG
LightRAG copied to clipboard
[Question]: The get_summary function in step_2 is a bit strange
Do you need to ask a question?
- [x] I have searched the existing question and discussions and this question is not already answered.
- [ ] I believe this is a legitimate question, not just a bug or feature request.
Your Question
def get_summary(context, tot_tokens=2000): tokens = tokenizer.tokenize(context) half_tokens = tot_tokens // 2
start_tokens = tokens[1000 : 1000 + half_tokens]
end_tokens = tokens[-(1000 + half_tokens) : 1000]
summary_tokens = start_tokens + end_tokens
summary = tokenizer.convert_tokens_to_string(summary_tokens)
return summary
This end_tokens is always empty Should it be changed to tokens[-(1000 + half_tokens) : -1000]
Additional Context
No response