mirror of
https://github.com/microsoft/graphrag.git
synced 2026-01-14 00:57:23 +08:00
Delete unused check_token_limit
This commit is contained in:
parent
8bf28187da
commit
bdc2485433
@ -1,15 +0,0 @@
|
||||
# Copyright (c) 2024 Microsoft Corporation.
|
||||
# Licensed under the MIT License
|
||||
|
||||
"""Token limit method definition."""
|
||||
|
||||
from graphrag.index.text_splitting.text_splitting import TokenTextSplitter
|
||||
|
||||
|
||||
def check_token_limit(text, max_token):
|
||||
"""Check token limit."""
|
||||
text_splitter = TokenTextSplitter(chunk_size=max_token, chunk_overlap=0)
|
||||
docs = text_splitter.split_text(text)
|
||||
if len(docs) > 1:
|
||||
return 0
|
||||
return 1
|
||||
Loading…
Reference in New Issue
Block a user