Download _backend/cli/graphrag_builder.py from IOE-IFAD/test: direct link, hf CLI and curl.
- Browser
- Download file 567 Bytes
-
https://huggingface.co/spaces/IOE-IFAD/test/resolve/main/_backend/cli/graphrag_builder.py
- Command line
-
hf download hf://spaces/IOE-IFAD/test/_backend/cli/graphrag_builder.py
-
curl -L -o graphrag_builder.py https://huggingface.co/spaces/IOE-IFAD/test/resolve/main/_backend/cli/graphrag_builder.py
567 Bytes
| from pathlib import Path | |
| from typing import List | |
| def build_graphrag(selected_files: List[Path], output_dir: Path) -> Path: | |
| """Placeholder GraphRAG build. | |
| For now it just writes a manifest enumerating selected files. | |
| Replace with actual GraphRAG pipeline integration. | |
| """ | |
| output_dir.mkdir(parents=True, exist_ok=True) | |
| manifest = output_dir / "graphrag_manifest.txt" | |
| manifest.write_text( | |
| "GraphRAG Build\nFiles:\n" + "\n".join(str(p) for p in selected_files), | |
| encoding="utf-8" | |
| ) | |
| return output_dir | |