Download scripts/reset_data.py from aimprabu/RAG_Documentation_Assistant: direct link, hf CLI and curl.
- Browser
- Download file 434 Bytes
-
https://huggingface.co/spaces/aimprabu/RAG_Documentation_Assistant/resolve/main/scripts/reset_data.py
- Command line
-
hf download hf://spaces/aimprabu/RAG_Documentation_Assistant/scripts/reset_data.py
-
curl -L -o reset_data.py https://huggingface.co/spaces/aimprabu/RAG_Documentation_Assistant/resolve/main/scripts/reset_data.py
434 Bytes
| import shutil | |
| import os | |
| import sqlite3 | |
| def reset_data(): | |
| print("Resetting operational data...") | |
| if os.path.exists("chroma_db"): | |
| print("Removing chroma_db directory...") | |
| shutil.rmtree("chroma_db") | |
| if os.path.exists("data/app.db"): | |
| print("Removing sqlite database...") | |
| os.remove("data/app.db") | |
| print("Data reset complete.") | |
| if __name__ == "__main__": | |
| reset_data() | |