-
Notifications
You must be signed in to change notification settings - Fork 91
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
Enable tool use #151
base: main
Are you sure you want to change the base?
Enable tool use #151
Conversation
be1f482
to
706e9a1
Compare
Happy to review this one when it's ready and #150 has been merged. |
249b2e5
to
a0dfba7
Compare
a0dfba7
to
60f3444
Compare
6b941a9
to
733ba57
Compare
@pcuenca, this is ready to go as soon as we can merge the update to Swift Jinja as well as the formatting in this repo. I'd love to move forward with this so that we can showcase the new capabilities in mlx-swift-examples. |
733ba57
to
8e973e4
Compare
@pcuenca, this is now using the latest release of Swift Jinja, so it's ready to review. |
Can we please remove the formatting changes from this PR 🙏? I'm still going through all the settings in swift-format and will provide feedback on #158. |
That would require a lot of tedious edits. If you changed your mind on your preferred formatting, a much easier solution would be for you to first merge your own formatting PR, and I'll rebase this PR using the new formatting. Or just use the formatting that we already agreed on. I ran formatting first on this PR because formatting differences often cause merge conflicts, and my Xcode uses two spaces for indentation. It's much easier to simply run the formatting before committing, and it's difficult to contribute to a repo that doesn't have consistent formatting. I'd also like to point out that automated formatting is an issue that other contributors have been asking for since April of last year, but you never followed through on that PR. |
@pcuenca, can we please move forward with this? I have contributed a significant amount of free labor so that people can use the capabilities of the latest models in Swift. There's a lot of interest right now in using DeepSeek R1 in particular. The solution here is simple and doesn't require much effort from you. You recently referred to this library as merely "experimental", but in fact it has become a critical piece of infrastructure for the Swift MLX ecosystem. As a contributor to this library as well as others downstream and upstream of it, I would appreciate it if you could be more responsive to PRs. Cc @julien-c |
7e9c186
to
f8739bf
Compare
Here is my proposed path forward, which will make things very easy for everyone: This repo needs some kind of automated formatting, which other contributors have been asking for since last year. Automated formatting is a part of nearly every major repository that people collaborate on, including nearly all of Hugging Face's public repos, because people have different IDE settings that result in different indentation and other differences. Automated formatting allows people to keep their preferred IDE settings and run one command to eliminate merge conflicts and unnecessary diffs. It's also very useful when pasting in code from LLMs, which often use different formatting. Running automated formatting allows you to see a clean diff. As for the specific rules, I will leave that entirely up to @pcuenca's judgement. Even an extremely minimal config with only rules for indentation and line length would already solve the problem. You can merge your preferred formatting with swift-format (see my PR for an example), and then I will format, squash, and rebase, and you will see only the changes relevant to this PR in one single commit. That's the beauty of formatting. |
Sure, we can do that, but:
As I tried to explain offline, swift-format has not been a huge priority so far, but I'll happily adopt it seeing you are contributing regularly to this project and other related ones. However, I don't think it'll be beneficial for the project to hastily adopt the set of syntax changes that were included in the PR. So my current thinking is to work on the following priorities this week:
|
f8739bf
to
151aff0
Compare
Thanks, I was able to cherry pick the key commit and resolve some conflicts. I didn't think of that possibility before, but I guess that's the beauty of git. Your plan sounds good to me. You can review this PR whenever you're able to. It's very difficult to test the tool use templates in Swift because of Swift's non-deterministic key order in dictionaries. We're already testing this in Jinja. I added a disabled test as a starting point in case we want to do this later. That would require importing swift-collections only for the tests and using |
Once johnmai-dev/Jinja#8 gets merged, this will enable tool use.
#158 needs to be merged before this PR.