Download scripts/find_vn.py from minhbe65/RAG-api: direct link, hf CLI and curl.
- Browser
- Download file 632 Bytes
-
https://huggingface.co/spaces/minhbe65/RAG-api/resolve/main/scripts/find_vn.py
- Command line
-
hf download hf://spaces/minhbe65/RAG-api/scripts/find_vn.py
-
curl -L -o find_vn.py https://huggingface.co/spaces/minhbe65/RAG-api/resolve/main/scripts/find_vn.py
632 Bytes
| import httpx | |
| BASE = "https://datasets-server.huggingface.co" | |
| DS = "th1nhng0/vietnamese-legal-documents" | |
| for so in ["45/2019/QH14", "10/2012/QH13", "145/2020/NĐ-CP"]: | |
| where = '"so_ky_hieu" = ' + "'" + so + "'" | |
| r = httpx.get( | |
| BASE + "/filter", | |
| params={"dataset": DS, "config": "metadata", "split": "data", "where": where, "limit": 20}, | |
| timeout=120, | |
| ) | |
| print("==", so, r.status_code) | |
| if r.status_code == 200: | |
| for row in r.json().get("rows", []): | |
| d = row["row"] | |
| print(" id=", d.get("id"), "| loai=", d.get("loai_van_ban"), "|", (d.get("title") or "")[:80]) | |