* implement LoRA / QLoRA - example of using MLX to fine-tune an LLM with low rank adaptation (LoRA) for a target task - see also https://arxiv.org/abs/2106.09685 - based on https://github.com/ml-explore/mlx-examples/tree/main/lora * add some command line flags I found useful during use - --quiet -- don't print decorator text, just the generated text - --prompt @/tmp/file.txt -- load prompt from file * user can specify path to model OR model identifier in huggingface * update mlx-swift reference Co-authored-by: Ashraful Islam <ashraful.meche@gmail.com> Co-authored-by: JustinMeans <46542161+JustinMeans@users.noreply.github.com>
16 lines
356 B
Swift
16 lines
356 B
Swift
// Copyright © 2024 Apple Inc.
|
|
|
|
import ArgumentParser
|
|
import Foundation
|
|
|
|
/// Extension to allow URL command line arguments.
|
|
extension URL: ExpressibleByArgument {
|
|
public init?(argument: String) {
|
|
if argument.contains("://") {
|
|
self.init(string: argument)
|
|
} else {
|
|
self.init(filePath: argument)
|
|
}
|
|
}
|
|
}
|