Commit Graph

30 Commits

Author SHA1 Message Date
David Koski
dfd79d0542 try to fix #59 and #57 (#60) 2024-04-26 00:09:22 -07:00
Awni Hannun
b951b78eb2 phi3 (#54)
* phi3

Co-authored-by: David Koski <dkoski@apple.com>
2024-04-24 09:31:01 -07:00
David Koski
6c0b66f90a implement LoRA / QLoRA (#46)
* 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>
2024-04-22 09:30:12 -07:00
David Koski
96b94b0df6 prepare for lora branch (#47)
- remove async llm generation -- this is just doubling our work
	- and does not match the style used in the example applications
- package generation parameters into a struct
- refactor command line arguments into distinct pieces based on their use
	- this will be reusable in the lora commands
2024-04-10 10:56:18 -07:00
Anchen
c27208812d chore: add repetition_penalty example (#45) 2024-04-04 15:15:50 -07:00
Anchen
2d0fdfe3a9 chore(llm-tool): add the top_p option in the llm-tool (#41)
* chore: add top p option in llm-tool
* chore: wire up the top p with async generate
2024-04-03 07:54:54 -07:00
Ronald Mannak
b3eb428c60 Add Package.swift (#39)
* Add Package.swift for LLM and MNIST
* Make ModelType properties public
* Make ModelType method createModel public
* Add installation instructions to readme
2024-04-01 11:04:02 -07:00
Florent Morin
e48e2ce2c9 Append visionOS support to LLMEval (#43)
* Update `mlx-swift` to last revision

* Add Apple Vision Target

* Update visionOS UI
2024-03-31 20:48:46 -07:00
Awni Hannun
15b38cd146 Use fast (#38)
* update to latest mlx swift and use fast norms
* gpu usage -> memory usage
2024-03-27 16:37:35 -07:00
Anchen
63531bc5fa feat: add command r model support (#35)
* feat: add command r model support
2024-03-26 12:43:10 -07:00
Ashraful Islam
c37018d7d2 feat: adds gpu usages stat in the toolbar (#36)
* feat: adds gpu usages stat in the toolbar
2024-03-25 10:29:54 -07:00
David Koski
857a10de91 make the mnist app/library targets match each other (#32)
* make the mnist app/library targets match each other
* switch mnist tool to 14.2 as well
2024-03-19 08:56:22 -07:00
Rounak
9e18eaa479 Add MNIST Digit Prediction/Inference (#22)
* Add Prediction to MNISTTrainer
2024-03-18 19:18:41 -07:00
Ashraful Islam
a7b2b54f18 LLMEval UI Improvements (#27)
* Feat: LLMEval UI Improvements

1. adds Markdown rendering in the UI
2. Adds init time and token/second stat
3. Minor UI enhancements

* feat: adds a copy to clipboard button for llm outputs

* adds scrollviewreader to sync with main

* ran pre-format to resolve formatting issues

* updates the missing dependency in project definition

* feat: switch between plain text and markdown

adds a segemented picker to switch between plain text and markdown
2024-03-18 09:15:50 -07:00
Pedro Cuenca
6c270a9d12 Remove Tokenizer wrapper (#28)
* Remove Tokenizer wrapper

Depends on https://github.com/huggingface/swift-transformers/pull/70

* Update swift-transformers revision
2024-03-18 09:07:52 -07:00
David Koski
0af2efe8a0 switch swift-tokenizers to main, remove some workarounds (#26)
* switch swift-tokenizers to main, remove some workarounds

- swift-tokenizers is getting a lot of updates and fixes, let's track main for now
- remove some workarounds that are no longer needed

- https://github.com/huggingface/swift-transformers/issues/63
2024-03-14 13:18:57 -07:00
David Koski
0fb74cbfdc adopt MLXFast.scaledDotProductAttention (#23) 2024-03-12 14:04:43 -07:00
John Mai
a94bf79d7e feat: Support Starcoder2 (#20)
* feat: Support Starcoder2
2024-03-07 21:28:37 -08:00
David Koski
430b464c8d pick up ios build fix (#15) 2024-03-04 20:26:37 -08:00
John Mai
66d9202360 feat: Qwen2 support 2024-03-03 22:26:28 +08:00
David Koski
9cea67f7bc add missing path to Info.plist -- fix #10 2024-03-01 22:20:29 -08:00
David Koski
82b86e4484 fix https://github.com/ml-explore/mlx-swift-examples/issues/8 -- do not specify info plist location 2024-03-01 19:49:19 -08:00
David Koski
2efd5575c7 remove dev team -- this needs to be supplied 2024-03-01 16:58:48 -08:00
David Koski
b41f14fba7 add LLM evaluator example
- runs on iOS and macOS
- downloads a model / tokenizer from hugging face
- evaluates the given prompt
2024-03-01 16:10:00 -08:00
David Koski
79e0620891 add MNIST training example 2024-03-01 15:55:36 -08:00
David Koski
82f6a969d4 llm improvements
- document the tokenizer used (https://github.com/huggingface/swift-transformers)
- provide a hook for tokenizer configuration, prompt augmentation
	- this isn't as rich as the python equivalents but it helps a little
2024-03-01 14:46:32 -08:00
Rudro Samanta
362f1c8ad8 Fix position of @main annotation
- Also update package versions otherwise things don't compile out of the box
  (you need the version where `callAsFunction` is marked `open`)
2024-02-27 13:02:13 -08:00
David Koski
4fad86d84b split tokenizer code out into new file 2024-02-26 14:42:40 -08:00
David Koski
c86d1c195e partial fix for #1
- handle loading models with different names for the safetensors files (gemma)
- handle merge tokens that can't be split
- organize code into Load/Evaluate
2024-02-26 13:23:21 -08:00
David Koski
b6d1e14465 initial commit 2024-02-22 10:41:02 -08:00