|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert left_token_count > 0, f"The LLM context length({llm_bdl.max_length}) is smaller than prompt({ext.prompt_token_count})" |
|
|
assert left_token_count > 0, f"The LLM context length({llm_bdl.max_length}) is smaller than prompt({ext.prompt_token_count})" |
|
|
|
|
|
|
|
|
BATCH_SIZE=1 |
|
|
|
|
|
|
|
|
BATCH_SIZE=4 |
|
|
texts, graphs = [], [] |
|
|
texts, graphs = [], [] |
|
|
cnt = 0 |
|
|
cnt = 0 |
|
|
threads = [] |
|
|
threads = [] |
|
|
exe = ThreadPoolExecutor(max_workers=12) |
|
|
|
|
|
|
|
|
exe = ThreadPoolExecutor(max_workers=50) |
|
|
for i in range(len(chunks)): |
|
|
for i in range(len(chunks)): |
|
|
tkn_cnt = num_tokens_from_string(chunks[i]) |
|
|
tkn_cnt = num_tokens_from_string(chunks[i]) |
|
|
if cnt+tkn_cnt >= left_token_count and texts: |
|
|
if cnt+tkn_cnt >= left_token_count and texts: |