File size: 860 Bytes
b2b6341
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os

def update_imports():
    backend_dir = r"c:\Users\dabaa\OneDrive\Desktop\dektop_content\Rag_System_2\backend"
    for root, dirs, files in os.walk(backend_dir):
        for file in files:
            if file.endswith(".py"):
                filepath = os.path.join(root, file)
                with open(filepath, "r", encoding="utf-8") as f:
                    content = f.read()
                
                # Replace specific faiss_store imports with vectorstore
                if "backend.vectorstore.faiss_store" in content:
                    content = content.replace("backend.vectorstore.faiss_store", "backend.vectorstore")
                    with open(filepath, "w", encoding="utf-8") as f:
                        f.write(content)
                    print(f"Updated: {filepath}")

if __name__ == "__main__":
    update_imports()