Spaces:
Runtime error
Runtime error
| import uuid | |
| import json | |
| from datetime import datetime | |
| import os | |
| class HFSpacePackager: | |
| def create_snapshot(self, data=None): | |
| snapshot_id = str(uuid.uuid4()) | |
| timestamp = datetime.now().strftime('%Y%m%d_%H%M%S') | |
| filename = f"snapshots/snapshot_{timestamp}_{snapshot_id[:8]}.json" | |
| # Save snapshot to file | |
| os.makedirs("snapshots", exist_ok=True) | |
| with open(filename, "w") as f: | |
| json.dump(data, f, indent=2) | |
| return f"https://huggingface.co/spaces/Leonydis137/Autonomous-AI/snapshots?file={filename}" |