ThinkRAG icon indicating copy to clipboard operation
ThinkRAG copied to clipboard

TypeError: Object of type Tag is not JSON serializable

Open richlysakowski opened this issue 11 months ago • 2 comments

When loading URLs I get this error message. I tried just loading the ThinkRAG webpage.
I got this same error with other webpages.

I am running ThinkRAG locally on Windows 10 Pro, Ollama, Llama3 LLM.

I tried fixing the code after these two errors, but I have not fixed it yet. I will post and synch the solution if I can get it working on my local installation.
######################################################### TypeError: Object of type Tag is not JSON serializable Traceback:

File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling result = func() ^^^^^^ File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 579, in code_to_exec exec(code, module.dict) File "C:\Users\PowerUser\Documents\Github_RSL_Utils\ThinkRAG\app.py", line 55, in pg.run() File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\site-packages\streamlit\navigation\page.py", line 303, in run exec(code, module.dict) File "C:\Users\PowerUser\Documents\Github_RSL_Utils\ThinkRAG\frontend\KB_Web.py", line 61, in handle_website() File "C:\Users\PowerUser\Documents\Github_RSL_Utils\ThinkRAG\frontend\KB_Web.py", line 55, in handle_website st.session_state.index_manager.load_websites(st.session_state["websites"], chunk_size, chunk_overlap) File "C:\Users\PowerUser\Documents\Github_RSL_Utils\ThinkRAG\server\index.py", line 96, in load_websites nodes = pipeline.run(documents=documents) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PowerUser\Documents\Github_RSL_Utils\ThinkRAG\server\ingestion.py", line 52, in run nodes = super().run(documents=documents) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\site-packages\llama_index\core\instrumentation\dispatcher.py", line 311, in wrapper result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\site-packages\llama_index\core\ingestion\pipeline.py", line 560, in run self.vector_store.add(nodes_with_embeddings) File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\site-packages\llama_index\core\vector_stores\simple.py", line 257, in add metadata = node_to_metadata_dict( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\site-packages\llama_index\core\vector_stores\utils.py", line 53, in node_to_metadata_dict metadata["node_content"] = json.dumps(node_dict) ^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\json_init.py", line 231, in dumps return _default_encoder.encode(obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\json\encoder.py", line 200, in encode chunks = self.iterencode(o, _one_shot=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\json\encoder.py", line 258, in iterencode return _iterencode(o, 0) ^^^^^^^^^^^^^^^^^ File "C:\ProgramData\Anaconda3\envs\ThinkRAG\Lib\json\encoder.py", line 180, in default raise TypeError(f'Object of type {o.class.name} '

richlysakowski avatar Jan 12 '25 04:01 richlysakowski

Have you resolved this issue on Windows?

wzdavid avatar Jan 21 '25 07:01 wzdavid

Not yet. Nothing has been done on this in > 2 months and there is no support for Windows.
I gave up and moved on to other RAG applications. It looks like the project is DEAD.

I will wait until there is renewed activities by the project owner or other developers who have forked it and are actively fixing and extending it for Windows. Was this an academic demo?

The goals and concepts are nice, but it must implement everything with conda and Windows to have a large audience. Mac-only or Linux-only support is too academic, not mainstream.

richlysakowski avatar Apr 27 '25 01:04 richlysakowski