update
Browse files1195 unmodified lines11961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201195 unmodified linesprint(f"[Duplicate] Duplicating {from_space_id} to {to_space_id}")# Prepare duplicate_space parameters# Per docs: "The new Space will be created in your account and will be in the same# state as the original Space (running or paused)"# Don't specify hardware/storage - let HuggingFace duplicate automaticallyduplicate_params = {"from_id": from_space_id,"to_id": to_space_name, # Just the name, not full ID"token": token,"exist_ok": True# Note: Not setting private, hardware, storage, secrets, variables# to ensure TRUE duplication (HF copies everything automatically)}# Only set private if explicitly requestedif private:duplicate_params["private"] = private# Duplicate the space (HuggingFace automatically copies all settings)print(f"[Duplicate] Duplicating {from_space_id} to {username}/{to_space_name}")print(f"[Duplicate] Letting HuggingFace handle hardware/storage/secrets automatically")duplicated_repo = duplicate_space(**duplicate_params)# Extract space URL1195 unmodified lines119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241195 unmodified linesprint(f"[Duplicate] Duplicating {from_space_id} to {to_space_id}")# Prepare duplicate_space parametersduplicate_params = {"from_id": from_space_id,"to_id": to_space_name, # Just the name, not full ID"token": token,"exist_ok": True}# Add hardware and storage if detected (required for GPU spaces)if original_hardware:duplicate_params["hardware"] = original_hardwareprint(f"[Duplicate] Adding hardware: {original_hardware}")if original_storage and original_storage.get('requested'):duplicate_params["storage"] = original_storage.get('requested')print(f"[Duplicate] Adding storage: {original_storage.get('requested')}")# Only set private if explicitly requestedif private:duplicate_params["private"] = private# Duplicate the spaceprint(f"[Duplicate] Duplicating {from_space_id} to {username}/{to_space_name}")print(f"[Duplicate] Parameters: {list(duplicate_params.keys())}")duplicated_repo = duplicate_space(**duplicate_params)# Extract space URL
backend_deploy.py+11-7