Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jaideepr97
Copy link
Member

@jaideepr97 jaideepr97 commented Jan 21, 2025

This PR redesigns ilab model convert to work as a completely independent command. Previously it was only usable on macOS and performed additional steps such as adapter fusing etc. In this rewrite there are no assumptions made, and the command strictly performs only conversion operations, which allows us to use it on any platform

at present only safetensors -> GGUF conversions are supported but the conversion mechanism has been made such that it is easily extensible for any new conversions to be added in the future

NOTE: the llamacpp/convert_to_gguf.py script has been borrowed from llamacpp, and it replaces the old conversion script. As such, no code changes should be done there

Issue resolved by this Pull Request:
Resolves #2351

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the
    conventional commits.
  • Changelog updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Functional tests have been added, if necessary.
  • E2E Workflow tests have been added, if necessary.

@mergify mergify bot added testing Relates to testing dependencies Relates to dependencies ci-failure PR has at least one CI failure labels Jan 21, 2025
@jaideepr97 jaideepr97 marked this pull request as ready for review January 22, 2025 14:57
@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 22, 2025
@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 22, 2025
@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 22, 2025
@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 23, 2025
@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 23, 2025
@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 23, 2025
@nathan-weinberg nathan-weinberg requested a review from a team January 23, 2025 16:32
Copy link
Contributor

@courtneypacheco courtneypacheco left a comment

Choose a reason for hiding this comment

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

Had some questions about unit testing.

@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 23, 2025
@mergify mergify bot added the ci-failure PR has at least one CI failure label Jan 27, 2025
@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 27, 2025
@mergify mergify bot added the one-approval PR has one approval from a maintainer label Jan 27, 2025
Copy link
Member

@nathan-weinberg nathan-weinberg left a comment

Choose a reason for hiding this comment

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

Two minor comments but otherwise LGTM

Comment on lines +48 to +49
Path(model),
Path(destination),
Copy link
Member

Choose a reason for hiding this comment

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

Seems weird to cast a Path when we are expecting a Path type in the first place

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, for whatever reason click was still accepting it as a str even after i set the flag type as path
so i had to add this to make sure it actually was a path at all times

@mergify mergify bot removed the one-approval PR has one approval from a maintainer label Jan 27, 2025
@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 27, 2025
Signed-off-by: Jaideep Rao <[email protected]>
Signed-off-by: Charlie Doern <[email protected]>
@mergify mergify bot added ci-failure PR has at least one CI failure and removed ci-failure PR has at least one CI failure labels Jan 27, 2025
output_type: str = self.ftype.name.partition("_")[2]

# Filename Output
if self.fname_out.is_dir():
Copy link

Choose a reason for hiding this comment

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

Test is failing on this line. Apparently problem is we lost Path type of fname_out and intended. And somewhere variable was casted to String


self.dir_model = dir_model
self.ftype = ftype
self.fname_out = fname_out
Copy link

@mchoma mchoma Feb 28, 2025

Choose a reason for hiding this comment

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

Suggested change
self.fname_out = fname_out
self.fname_out = Path(fname_out)

To make code more robust and prevent similar error like described in https://github.com/instructlab/instructlab/pull/2950/files#r1975005755 . My theory is caller of constructor may provide String instead of Path for fname_out

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had activity within 60 days. It will be automatically closed if no further activity occurs within 30 days.

@github-actions github-actions bot added the stale label May 17, 2025
@mergify
Copy link
Contributor

mergify bot commented May 17, 2025

This pull request has merge conflicts that must be resolved before it can be merged. @jaideepr97 please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase This Pull Request needs to be rebased label May 17, 2025
@github-actions github-actions bot removed the stale label May 21, 2025
@booxter
Copy link
Contributor

booxter commented Jun 18, 2025

AFAIU this work won't move forward, so closing.

@booxter booxter closed this Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-failure PR has at least one CI failure dependencies Relates to dependencies hold In-progress PR. Tag should be removed before merge. needs-rebase This Pull Request needs to be rebased testing Relates to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesign ilab model convert

7 participants