[Bug]: json.decoder.JSONDecodeError: Unterminated string starting at WHEN generate_text_embeddings #1549
Closed
2 of 3 tasks
Labels
autoresolved
awaiting_response
Maintainers or community have suggested solutions or requested info, awaiting filer response
bug
Something isn't working
stale
Used by auto-resolve bot to flag inactive issues
Do you need to file an issue?
Describe the bug
json.decoder.JSONDecodeError: Unterminated string starting at WHEN generate_text_embeddings
Could you tell me how toc cope with this?
Thank you so much!!
Steps to reproduce
graphrag index --root ./rag_book
Expected Behavior
No response
GraphRAG Config Used
Logs and screenshots
14:00:59,942 httpx INFO HTTP Request: POST https://platform.llmprovider.ai/v1/chat/completions "HTTP/1.1 200 OK"
15:52:48,215 graphrag.callbacks.file_workflow_callbacks INFO Error Invoking LLM details={'prompt': ['JOHN WILEY & SONS, INC.:John Wiley & Sons, Inc. is a publishing company known for its scientific and academic publications, including works on immunology.', 'AMERICAN JOURNAL OF EPIDEMIOLOGY:The American Journal of Epidemiology publishes research related to epidemiology and public health, featuring studies like the one on Guillain-Barre syndrome during the H1N1 vaccination campaign.', 'CURRENT PROTOCOLS IN IMMUNOLOGY:A publication that provides standardized procedures and protocols for immunology research, including vaccine studies.', 'PACKAGING REGULATIONS:Regulations concerning the development, safety, and distribution of vaccines and biological agents.', 'VACCINES AND ADJUVANTS SAFETY PROJECT COMMITTEE:A committee focusing on the safety evaluation of vaccines and their adjuvants.', 'M. THE EX VIVO IFN-G ENZYME-LINKED IMMUNOSPOT ASSAY:', 'YURASOV S:Yurasov S is an author who has contributed research in the field of rheumatology.', 'NUSSENZWEIG MC:Nussenzweig MC is a researcher noted for work on autoreactive antibodies and their regulation.', 'ZAITSEVA M:Zaitseva M is an author involved in research regarding the use of human MonoMac6 cells.', 'ROMANTSEVA T:Romantseva T is a collaborator on research surrounding vaccine safety.', 'BLINOVA K:Blanova K contributed to research on the in vitro assay predictive of adjuvant safety.', 'DRANE D:Drane D is an author associated with immunopotentiators in modern vaccines.', 'VACCINE 2012:Vaccine 2012 is a significant event or publication discussing advancements in vaccine research and safety.', 'CURRENTS OPINION RHEUMATOL:Current Opinion in Rheumatology is a journal that discusses contemporary issues in rheumatology.', 'MONOMAC6:', 'VERTEBRATE ADAPTIVE IMMUNE CELLS:The immune cells that possess two types of antigen receptors, immunoglobulins and T-cell receptors, crucial for adaptive immunity.'], 'kwargs': {}}
15:52:48,216 datashaper.workflow.workflow ERROR Error executing verb "generate_text_embeddings" in generate_text_embeddings: Unterminated string starting at: line 1 column 107183 (char 107182)
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.12/site-packages/datashaper/workflow/workflow.py", line 415, in _execute_verb
result = await result
^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/workflows/v1/generate_text_embeddings.py", line 96, in workflow
await generate_text_embeddings(
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/flows/generate_text_embeddings.py", line 100, in generate_text_embeddings
await _run_and_snapshot_embeddings(
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/flows/generate_text_embeddings.py", line 123, in _run_and_snapshot_embeddings
data["embedding"] = await embed_text(
^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/operations/embed_text/embed_text.py", line 89, in embed_text
return await _text_embed_with_vector_store(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/operations/embed_text/embed_text.py", line 179, in _text_embed_with_vector_store
result = await strategy_exec(
^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/operations/embed_text/strategies/openai.py", line 62, in run
embeddings = await _execute(llm, text_batches, ticker, semaphore)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/operations/embed_text/strategies/openai.py", line 102, in _execute
results = await asyncio.gather(*futures)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/operations/embed_text/strategies/openai.py", line 96, in embed
chunk_embeddings = await llm(chunk)
^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/base/base.py", line 112, in call
return await self._invoke(prompt, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/base/base.py", line 128, in _invoke
return await self._decorated_target(prompt, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/retryer.py", line 109, in invoke
result = await execute_with_retry()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/retryer.py", line 93, in execute_with_retry
async for a in AsyncRetrying(
File "/root/miniconda3/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 166, in anext
do = await self.iter(retry_state=self._retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 153, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/tenacity/_utils.py", line 99, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/tenacity/init.py", line 398, in
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/retryer.py", line 101, in execute_with_retry
return await attempt()
^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/retryer.py", line 78, in attempt
return await delegate(prompt, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/rate_limiter.py", line 70, in invoke
result = await delegate(prompt, **args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/base/base.py", line 152, in _decorator_target
output = await self._execute_llm(prompt, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/openai/llm/embeddings.py", line 133, in _execute_llm
response = await self._call_embeddings_or_cache(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/openai/llm/embeddings.py", line 110, in _call_embeddings_or_cache
return await self._cache.get_or_insert(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/cache_interactor.py", line 50, in get_or_insert
entry = await func()
^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/resources/embeddings.py", line 236, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1843, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1537, in request
return await self._request(
^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1640, in _request
return await self._process_response(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1737, in _process_response
return await api_response.parse()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_response.py", line 431, in parse
await self.read()
^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_response.py", line 266, in _parse
data = response.json()
^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/httpx/_models.py", line 832, in json
return jsonlib.loads(self.content, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 107183 (char 107182)
15:52:48,218 graphrag.callbacks.file_workflow_callbacks INFO Error executing verb "generate_text_embeddings" in generate_text_embeddings: Unterminated string starting at: line 1 column 107183 (char 107182) details=None
15:52:48,225 graphrag.index.run.run ERROR error running workflow generate_text_embeddings
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/run/run.py", line 262, in run_pipeline
result = await _process_workflow(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/run/workflow.py", line 103, in _process_workflow
result = await workflow.run(context, callbacks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/datashaper/workflow/workflow.py", line 369, in run
timing = await self._execute_verb(node, context, callbacks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/datashaper/workflow/workflow.py", line 415, in _execute_verb
result = await result
^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/workflows/v1/generate_text_embeddings.py", line 96, in workflow
await generate_text_embeddings(
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/flows/generate_text_embeddings.py", line 100, in generate_text_embeddings
await _run_and_snapshot_embeddings(
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/flows/generate_text_embeddings.py", line 123, in _run_and_snapshot_embeddings
data["embedding"] = await embed_text(
^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/operations/embed_text/embed_text.py", line 89, in embed_text
return await _text_embed_with_vector_store(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/operations/embed_text/embed_text.py", line 179, in _text_embed_with_vector_store
result = await strategy_exec(
^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/operations/embed_text/strategies/openai.py", line 62, in run
embeddings = await _execute(llm, text_batches, ticker, semaphore)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/operations/embed_text/strategies/openai.py", line 102, in _execute
results = await asyncio.gather(*futures)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/graphrag/index/operations/embed_text/strategies/openai.py", line 96, in embed
chunk_embeddings = await llm(chunk)
^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/base/base.py", line 112, in call
return await self._invoke(prompt, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/base/base.py", line 128, in _invoke
return await self._decorated_target(prompt, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/retryer.py", line 109, in invoke
result = await execute_with_retry()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/retryer.py", line 93, in execute_with_retry
async for a in AsyncRetrying(
File "/root/miniconda3/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 166, in anext
do = await self.iter(retry_state=self._retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 153, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/tenacity/_utils.py", line 99, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/tenacity/init.py", line 398, in
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/retryer.py", line 101, in execute_with_retry
return await attempt()
^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/retryer.py", line 78, in attempt
return await delegate(prompt, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/rate_limiter.py", line 70, in invoke
result = await delegate(prompt, **args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/base/base.py", line 152, in _decorator_target
output = await self._execute_llm(prompt, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/openai/llm/embeddings.py", line 133, in _execute_llm
response = await self._call_embeddings_or_cache(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/openai/llm/embeddings.py", line 110, in _call_embeddings_or_cache
return await self._cache.get_or_insert(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/fnllm/services/cache_interactor.py", line 50, in get_or_insert
entry = await func()
^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/resources/embeddings.py", line 236, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1843, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1537, in request
return await self._request(
^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1640, in _request
return await self._process_response(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1737, in _process_response
return await api_response.parse()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_response.py", line 431, in parse
await self.read()
^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/openai/_response.py", line 266, in _parse
data = response.json()
^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/httpx/_models.py", line 832, in json
return jsonlib.loads(self.content, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 107183 (char 107182)
15:52:48,229 graphrag.callbacks.file_workflow_callbacks INFO Error running pipeline! details=None
15:52:48,254 graphrag.cli.index ERROR Errors occurred during the pipeline run, see logs for more details.
Additional Information
The text was updated successfully, but these errors were encountered: