Download scripts/run_diff.py from minhbe65/RAG-api: direct link, hf CLI and curl.
- Browser
- Download file 440 Bytes
-
https://huggingface.co/spaces/minhbe65/RAG-api/resolve/main/scripts/run_diff.py
- Command line
-
hf download hf://spaces/minhbe65/RAG-api/scripts/run_diff.py
-
curl -L -o run_diff.py https://huggingface.co/spaces/minhbe65/RAG-api/resolve/main/scripts/run_diff.py
440 Bytes
| """Chạy so sánh phiên bản BLLĐ 2012 -> 2019, ghi quan hệ sửa đổi vào Postgres.""" | |
| from app.amend.store import diff_documents | |
| from app.db.base import SessionLocal | |
| db = SessionLocal() | |
| diffs = diff_documents(db, "blld2012", "blld2019", write=True) | |
| from collections import Counter | |
| c = Counter(d["change_type"] for d in diffs) | |
| print("Tổng cặp:", len(diffs)) | |
| for k, v in c.most_common(): | |
| print(f" {k}: {v}") | |
| db.close() | |