Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Upload update_data.py with huggingface_hub
Browse files- update_data.py +10 -0
update_data.py
CHANGED
|
@@ -127,6 +127,16 @@ def main() -> None:
|
|
| 127 |
for script in scripts_to_run:
|
| 128 |
print(f" - {script}")
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
# Initialize pipeline status tracking
|
| 131 |
status = PipelineStatus()
|
| 132 |
triggered_by = os.environ.get("PIPELINE_TRIGGERED_BY", "cli")
|
|
|
|
| 127 |
for script in scripts_to_run:
|
| 128 |
print(f" - {script}")
|
| 129 |
|
| 130 |
+
# Download existing data from HuggingFace so generate scripts can skip
|
| 131 |
+
# already-processed bills (avoids re-generating reports/summaries after rebuild)
|
| 132 |
+
print("\nDownloading existing data from HuggingFace...")
|
| 133 |
+
try:
|
| 134 |
+
from huggingface_upload import download_from_huggingface
|
| 135 |
+
downloaded = download_from_huggingface()
|
| 136 |
+
print(f"✓ Downloaded {len(downloaded)} files from HuggingFace")
|
| 137 |
+
except Exception as e:
|
| 138 |
+
print(f"⚠ HuggingFace download skipped: {e}")
|
| 139 |
+
|
| 140 |
# Initialize pipeline status tracking
|
| 141 |
status = PipelineStatus()
|
| 142 |
triggered_by = os.environ.get("PIPELINE_TRIGGERED_BY", "cli")
|