Skip to content

Commit 4b9f268

Browse files
Fix/query embedding (#909)
* fix strategy config in entity_extraction * should not post token list to the embedding model * fix embedding in local query * add sembersioner * remove strategy --------- Co-authored-by: KylinMountain <kose2livs@gmail.com>
1 parent 3f31af8 commit 4b9f268

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "patch",
3+
"description": "fix query embedding"
4+
}

graphrag/query/llm/text_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ def chunk_text(
3939
token_encoder = tiktoken.get_encoding("cl100k_base")
4040
tokens = token_encoder.encode(text) # type: ignore
4141
chunk_iterator = batched(iter(tokens), max_tokens)
42-
yield from chunk_iterator
42+
yield from (token_encoder.decode(list(chunk)) for chunk in chunk_iterator)

0 commit comments

Comments
 (0)