Intelex / scripts /update_imports.py
yakub
Initial cloud-ready commit
b2b6341
Raw
History Blame Contribute Delete
860 Bytes
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()