Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] File integrity check for downloaded models #159

Merged
merged 6 commits into from
Jan 5, 2025

Conversation

a-ghorbani
Copy link
Owner

@a-ghorbani a-ghorbani commented Jan 5, 2025

Description

Added a file integrity verification check for downloaded models to ensure file consistency and help users identify corrupted downloads as opposed to model loading fails.

  • Added checkModelFileIntegrity utility that:
    • Compares local file hash with HuggingFace's LFS hash (lfs.oid)
    • Fetches missing file details from HF when needed (for backward compatibility)
    • Compares actual file size on disk with expected size for display only
  • Added visual warning when integrity check fails

Platform Affected

  • iOS
  • Android

Checklist

  • Necessary comments have been made.
  • I have tested this change on:
    • iOS Simulator/Device
    • Android Emulator/Device
  • Unit tests and integration tests pass locally.

@a-ghorbani a-ghorbani marked this pull request as ready for review January 5, 2025 19:44
@a-ghorbani a-ghorbani merged commit 097b08d into main Jan 5, 2025
2 of 3 checks passed
@a-ghorbani a-ghorbani deleted the feat/check-file-integrity branch January 5, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant