Commit Graph

164 Commits

Author SHA1 Message Date
Vaibhav Srivastav
06b7c45c59 Add URLs to HF MLX-Community org. (#153)
* up

* Add ref to MLX org on the README.

* nit: language.

* Standardise org name.
2023-12-20 06:57:13 -08:00
Pedro Cuenca
03720a270e Add --model_path to phi-2 example script (#152) 2023-12-20 06:14:35 -08:00
Sarthak Yadav
0fb147650f Added Keyword Spotting Transformer + SpeechCommands example (#123)
* Added Keyword Transformer + SpeechCommands

* minor fixes in README

* some updates / simplifications

* nits

* fixed kwt skip connections

* readme + format

* updated acknowledgements

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2023-12-19 14:17:48 -08:00
Juarez Bochi
50a703eb3b T5: Change default dtype to bfloat16 (#147)
* T5: Change default to bfloat16

* Add myself to contributors

* t5: Change convert.py default to float32
2023-12-19 13:44:36 -08:00
Junyi Mei
b439b96aa1 Add Qwen example (#134)
* Add qwen model draft

* Add readme and requirements for qwen example

* Add model and tokenizer options

* Fix convert and tokenizer

* some updates / style consistency

* move to llm subdir

* readme nit

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2023-12-19 13:06:19 -08:00
Juarez Bochi
b5ff25716f Add T5 and Flan-T5 example (#113)
* Add skeleton

* Load all encoder weights

* Pass config to all modules, fix ln

* Load position bias embeddings

* Load decoder weights

* Move position biases to attention module

* translate pytorch to mx

* Fix default prompt

* Fix relative_attention_max_distance config

* No scaling, no encoder mask

* LM head

* Decode (broken after 1st token)

* Use position bias in all layers

* Utils to compare encoder output

* Fix layer norm

* Fix decoder mask

* Use position bias in decoder

* Concatenate tokens

* Remove prints

* Stop on eos

* Measure tokens/s

* with cache

* bug fix with bidirectional only for encoder, add offset to position bias

* format

* Fix T5.__call__

* Stream output

* Add argument to generate float16 npz

* Load config from HF to support any model

* Uncomment bidirectional param

* Add gitignore

* Add readme.md for t5

* Fix relative position scale

* Fix --encode-only

* Run hf_t5 with any model

* Add hf generation for comparison

* Fix type for attention mask

* Increase hf max_length

* Rescale output before projecting on vocab

* readme updates

* nits

* Pass ln2 to cross attention

* Fix example

* Fix attention for 3b model

* fp16, abstract tokenizer a bit, format

* clamp for low precision

* higher clipping, remove non-helpful casts

* default to fp32 for now

* Adds support for flan-t5

* Update t5 docs on variant support

* readme flan

* nit

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2023-12-18 20:25:34 -08:00
Awni Hannun
9063f1a1e3 fix use for llama 2 from meta (#144) 2023-12-18 19:33:17 -08:00
Daniel Strobusch
60c3bd9bc7 Pass few shot file name to --few-shot arg(#141) 2023-12-18 13:30:04 -08:00
Awni Hannun
fd00c22224 Citation + contributor acknowledgments section (#136)
* citation + acks section

* nits
2023-12-18 10:12:35 -08:00
Daniel Strobusch
ca5a8ec273 fix renamed arg (#140) 2023-12-18 10:11:51 -08:00
Awni Hannun
17d2efaebe support for tiny llama (#129) 2023-12-18 07:47:55 -08:00
Awni Hannun
6ae68777aa Rope theta to support Coda Llama (#121)
* rope theta for llama model

* llama chat/code

* nit
2023-12-15 19:51:51 -08:00
Awni Hannun
376b273b2f Merge pull request #115 from ml-explore/lora_custom
Customize dataset with lora
2023-12-15 13:54:58 -08:00
Awni Hannun
ad77bc4c3b minimum version 2023-12-15 13:54:31 -08:00
Pawel Kowalski
4c88163941 Stable diffusion - check model weights shape and support int for "attention_head_dim" (#85)
* Allow integer as attention_head_dim
* Reshape downloaded weights to match model if there is a mismatch
2023-12-15 13:01:02 -08:00
Awni Hannun
fc13e96e6c Merge pull request #116 from idoru/fix-phi-2-temp-arg
phi-2: fix --temp/--seed arguments.
2023-12-15 12:29:19 -08:00
Awni Hannun
e709b846ff 32 GB example 2023-12-15 12:20:15 -08:00
Awni Hannun
24a6de2acb 32 GB example 2023-12-15 12:18:29 -08:00
Sam Coward
a5bacfd04f Pass along temp argument to generate() 2023-12-15 15:16:41 -05:00
Awni Hannun
f019d836ee keep base weights in fp16 2023-12-15 10:42:18 -08:00
Awni Hannun
6dc067d30c use lower precision base weights 2023-12-15 10:29:42 -08:00
Awni Hannun
4444c7a4a5 more nits 2023-12-15 10:06:14 -08:00
Awni Hannun
c889e09773 fix readme 2023-12-15 09:59:07 -08:00
Awni Hannun
9550e1de17 custom data with lora 2023-12-15 09:56:10 -08:00
Awni Hannun
7d4a41ace8 Merge pull request #112 from ml-explore/fix_mixtral
[Bugfix] Fix RoPE base bug in Mixtral example
2023-12-15 08:39:02 -08:00
Awni Hannun
737db11152 Merge pull request #108 from devonthomas35/phi2_eos
Phi-2: Stop generating at eos token
2023-12-15 07:34:11 -08:00
Awni Hannun
001b5803ce fix RoPE bug + minor updates 2023-12-14 21:45:25 -08:00
devonthomas35
f6ac70c736 Refactor EOS check 2023-12-14 21:11:23 -08:00
Awni Hannun
12a5597ac3 Merge pull request #107 from ml-explore/hf_mixtral
Use official HF for mixtral
2023-12-14 16:57:19 -08:00
Awni Hannun
7cf66dc88c format 2023-12-14 16:56:50 -08:00
devonthomas35
7f992db5bc Remove unnecessary return 2023-12-14 15:52:22 -08:00
devonthomas35
8d496ba61a Stop generating at eos token 2023-12-14 15:50:59 -08:00
Awni Hannun
6249f46215 incude instruct option 2023-12-14 15:40:38 -08:00
Awni Hannun
449f7a694b use official HF for mixtral 2023-12-14 15:30:32 -08:00
Awni Hannun
95a1d50318 Merge pull request #106 from fahnub/main
minor dependency fix in phi-2
2023-12-14 14:15:19 -08:00
Fahad Nadeem
330e8e8bc9 minor dep fix in phi 2023-12-15 03:09:33 +05:00
Awni Hannun
53e58795c2 Merge pull request #77 from SarthakYadav/main
Added CIFAR-10 + ResNet example
2023-12-14 12:19:40 -08:00
Awni Hannun
e12e4d5825 typo / nits 2023-12-14 12:14:01 -08:00
Awni Hannun
5673716daa updates + format 2023-12-14 12:09:10 -08:00
Awni Hannun
4cac181917 Merge pull request #103 from arpitingle/patch-1
added phi in readme
2023-12-14 10:19:40 -08:00
arpit
541265b74d Update README.md 2023-12-14 23:40:50 +05:30
Awni Hannun
f4745d8576 Merge pull request #97 from jbarrow/main
Phi-2
2023-12-14 09:21:26 -08:00
Awni Hannun
fa9e34b041 cleanup conversion to use single qkv matrix 2023-12-14 09:19:44 -08:00
Awni Hannun
45c1800fc6 update readme 2023-12-14 08:37:34 -08:00
Awni Hannun
c2eb435697 change file name for consistency, update readme. 2023-12-14 08:34:24 -08:00
Awni Hannun
5822639f23 don't drop last tokens 2023-12-14 08:27:44 -08:00
Awni Hannun
c26eafc125 fix args, update README, remove extra files 2023-12-14 08:18:01 -08:00
Awni Hannun
05c82ddf5f fix fp16 + nits 2023-12-14 08:08:28 -08:00
Sarthak Yadav
879a576fb6 updated header 2023-12-14 16:28:00 +01:00
Awni Hannun
bb44222a86 Merge pull request #98 from finnless/patch-1
Fix typo in stable_diffusion README
2023-12-14 07:13:19 -08:00