| 69 | |
| 70 | |
| 71 | def _download_metric(): |
| 72 | import os |
| 73 | import shutil |
| 74 | from huggingface_hub import hf_hub_download |
| 75 | scrolls_metric_path = hf_hub_download(repo_id="tau/scrolls", repo_type="dataset", filename="metrics/scrolls.py") |
| 76 | updated_scrolls_metric_path = ( |
| 77 | os.path.dirname(scrolls_metric_path) + os.path.basename(scrolls_metric_path).replace(".", "_") + ".py" |
| 78 | ) |
| 79 | shutil.copy(scrolls_metric_path, updated_scrolls_metric_path) |
| 80 | return updated_scrolls_metric_path |
| 81 | |
| 82 | |
| 83 | def _process_doc_prepended_question(doc): |