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

chore: update model's size on import #1630

Merged
merged 6 commits into from
Nov 4, 2024

Conversation

louis-menlo
Copy link
Contributor

@louis-menlo louis-menlo commented Nov 4, 2024

Describe Your Changes

This PR updates the model's size on import as supported in the pull request. It includes minor refactoring of file size extension and consolidates features using the std::filesystem API.

Changes made

The provided git diff reflects several modifications across multiple files in the project. Here's a concise summary of these changes:

  1. gguf_parser.cc:

    • Replaced manual file size determination with std::filesystem::file_size for reliability and simplicity.
    • Removed redundant code related to the old method of fetching the file size.
  2. models.cc:

    • Introduced std::filesystem::file_size to fetch the file size when importing models, storing this size in the model_config.
  3. download_service.cc and download_service.h:

    • Removed the custom GetLocalFileSize method and replaced its usage with std::filesystem::file_size for determining file sizes.
    • The download_service.h file had the method deleted from class specifications.
    • Adjustments were made to ensure curl_easy_setopt uses the new size-fetching method directly.

These changes simplify and modernize file size handling by leveraging the C++17 <filesystem> library.

@louis-menlo louis-menlo force-pushed the chore/update-model-size-on-import branch from bd909a1 to 10ce225 Compare November 4, 2024 11:42
@louis-menlo louis-menlo requested a review from a team November 4, 2024 12:13
Copy link
Collaborator

@namchuai namchuai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ thank you!

@louis-menlo louis-menlo merged commit 206650f into dev Nov 4, 2024
4 checks passed
@louis-menlo louis-menlo deleted the chore/update-model-size-on-import branch November 4, 2024 13:57
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.

2 participants