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

Support more training data structures in LoRA #191

Closed
wants to merge 0 commits into from

Conversation

ronaldmannak
Copy link
Contributor

@ronaldmannak ronaldmannak commented Jan 31, 2025

This is a draft pull request to add support for chat, tool, and completion data structures as documented in MLX-examples and discussed in #189. As of now it's still incomplete and the scope has expanded quite significantly since there needs to be a rewrite of train() to accommodate the different data structures.

}

if let _ = try? decoder.decode(ToolStructure.self, from: data) {
return { _ in line }
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is not supported? Should it produce an error rather than silent failure?

.components(separatedBy: .newlines)
.filter {
$0.first == "{"
private func determineDecoder(line: String) throws -> (Data) throws -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be valuable to return a protocol like LoRAData? Then the structs below could implement that along with the conversion to String. This would be useful for callers who wanted the structured data for some reason (if that seems reasonable).

Not strictly required I think because the training is going to compare string (token) outputs, right?

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