deshnaashok commited on
Commit
2ea4404
Β·
1 Parent(s): 25ef36b

Fix all indentation for vector DB auto-generation in Hugging Face Spaces

Browse files
Files changed (1) hide show
  1. enhanced_rag_chatbot.py +10 -10
enhanced_rag_chatbot.py CHANGED
@@ -41,18 +41,18 @@ class EnhancedRAGChatbot:
41
  path=str(VECTOR_DB_DIR),
42
  settings=Settings(anonymized_telemetry=False)
43
  )
 
 
 
 
44
  try:
 
 
45
  self.collection = self.client.get_collection("rackspace_knowledge")
46
- except Exception as e:
47
- print("❌ Vector DB or collection missing! Attempting to rebuild...")
48
- try:
49
- import subprocess
50
- subprocess.run(["python", "enhanced_vector_db.py"], check=True)
51
- self.collection = self.client.get_collection("rackspace_knowledge")
52
- print("βœ… Vector DB rebuilt successfully!")
53
- except Exception as rebuild_e:
54
- print("❌ Failed to rebuild vector DB. Please run 'python enhanced_vector_db.py' manually.")
55
- self.collection = None
56
 
57
  # Load embedding model (still needed for RAG)
58
  print(f"πŸ”€ Loading embedding model: {EMBEDDING_MODEL}")
 
41
  path=str(VECTOR_DB_DIR),
42
  settings=Settings(anonymized_telemetry=False)
43
  )
44
+ try:
45
+ self.collection = self.client.get_collection("rackspace_knowledge")
46
+ except Exception as e:
47
+ print("❌ Vector DB or collection missing! Attempting to rebuild...")
48
  try:
49
+ import subprocess
50
+ subprocess.run(["python", "enhanced_vector_db.py"], check=True)
51
  self.collection = self.client.get_collection("rackspace_knowledge")
52
+ print("βœ… Vector DB rebuilt successfully!")
53
+ except Exception as rebuild_e:
54
+ print("❌ Failed to rebuild vector DB. Please run 'python enhanced_vector_db.py' manually.")
55
+ self.collection = None
 
 
 
 
 
 
56
 
57
  # Load embedding model (still needed for RAG)
58
  print(f"πŸ”€ Loading embedding model: {EMBEDDING_MODEL}")