You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address code review feedback for HuggingFace deployer
Implements 8 improvements from code review:
1. Add organization support for deploying to HF organizations
- Added 'organization' config parameter to HuggingFaceDeployerConfig
- Updated _get_space_id() to check organization before falling back to username
2. Add space name length validation
- Added HF_SPACE_NAME_MAX_LENGTH constant (96 chars)
- Validate space name length and raise DeployerError if exceeded
3. Handle space visibility updates
- Check if space_info.private != settings.private when updating
- Call api.update_repo_visibility() to apply visibility changes
4. Fail on invalid hardware/storage instead of warning
- Changed hardware/storage errors to raise DeploymentProvisionError
- Added clear error messages with documentation links
5. Use proper error types for 404 detection
- Import HfHubHTTPError from huggingface_hub.utils
- Check e.response.status_code == 404 instead of string matching
6. Document timeout parameter in deprovision
- Added docstring note that timeout is unused (deletion is immediate)
7. Remove unused space_exists variable
- Removed space_exists assignments to fix lint error
8. Update documentation terminology
- Changed "Docker applications" to "Docker Spaces" in deployers README
All changes maintain backward compatibility and improve code quality.
0 commit comments