Spaces:
Sleeping
Sleeping
Download load_docs.py from SushmithaCh/Digital-twin: direct link, hf CLI and curl.
- Browser
- Download file 349 Bytes
-
https://huggingface.co/spaces/SushmithaCh/Digital-twin/resolve/main/load_docs.py
- Command line
-
hf download hf://spaces/SushmithaCh/Digital-twin/load_docs.py
-
curl -L -o load_docs.py https://huggingface.co/spaces/SushmithaCh/Digital-twin/resolve/main/load_docs.py
349 Bytes
| import os | |
| import json | |
| from huggingface_hub import hf_hub_download | |
| def load_documents(): | |
| path = hf_hub_download( | |
| repo_id=os.getenv("HF_DATASET_REPO"), | |
| filename="docs.json", | |
| repo_type="dataset", | |
| token=os.getenv("HF_TOKEN"), | |
| ) | |
| with open(path) as f: | |
| return json.load(f) | |
| documents = load_documents() | |