Open TanGentleman opened 4 months ago
Seems like this specifically happens when self.rag_llm is set before self.chunk_size, and this error happened because I didn't have a manifest entry to use the settings from. In this case, we should force a re-ingest to form a new manifest, and clear the DB.
Do do this, I would want to handle the case (collection exists + manifest missing) -> re-index using available rag_settings.
Making great progress involving active.json to keep a current complete copy of the state + config. Here's the current error:
Enter your query: .r
Executing command
2024-07-07 16:59:34,578 - INFO - Rag mode set to True
2024-07-07 16:59:34,578 - INFO - Enabling RAG mode. Doing some validation steps
Collection ollama_example_collection exists!
Enter to continue, or type a new collection name.example_collection
Collection name set to example_collection
Collection example_collection exists!
Enter to continue, or type a new collection name.test
Collection name set to test
2024-07-07 17:00:01,946 - INFO - Checking if DB exists for inputs. Make sure this is after settings are finalized!
2024-07-07 17:00:01,946 - INFO - Set 1 inputs
{'rag_mode': True, 'collection_name': 'test', 'embedding_model': 'BAAI/bge-large-en-v1.5', 'method': 'chroma', 'chunk_size': 1000, 'chunk_overlap': 100, 'k_excerpts': 3, 'rag_llm': 'Qwen/Qwen2-72B-Instruct', 'inputs': ['https://example.com/'], 'multivector_enabled': False, 'multivector_method': 'summary'}
2024-07-07 17:00:01,946 - INFO - Primary model set to deepseek-coder
2024-07-07 17:00:01,946 - INFO - Backup model set to meta-llama/Llama-3-70b-chat-hf
2024-07-07 17:00:01,946 - INFO - System message set to You are a helpful AI.
2024-07-07 17:00:01,947 - INFO - Config initialized and set in active.json.
Already in RAG mode
Enter your query: info
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/tan/Documents/GitHub/Augmenta/framework/chat.py", line 1200, in <module>
main_cli()
File "/Users/tan/Documents/GitHub/Augmenta/framework/chat.py", line 1193, in main_cli
chatbot.chat(prompt, persistence_enabled=persistence_enabled)
File "/Users/tan/Documents/GitHub/Augmenta/framework/chat.py", line 1053, in chat
self.get_rag_response(prompt, stream=stream)
File "/Users/tan/Documents/GitHub/Augmenta/framework/chat.py", line 943, in get_rag_response
assert self.rag_chain is not None, "RAG chain not initialized"
^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: RAG chain not initialized
Error message:
I think I can put a bandaid on this one but I want to diagnose it more thoroughly and maybe use the setter/getters more effectively