Commit Graph

310 Commits

Author SHA1 Message Date
Junyi Mei
62b455f801
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
10a7b99e83
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
1e7f4a5921
fix use for llama 2 from meta (#144) 2023-12-18 19:33:17 -08:00
Daniel Strobusch
1d62b3ecc1
Pass few shot file name to --few-shot arg(#141) 2023-12-18 13:30:04 -08:00
Awni Hannun
517f5808fc
Citation + contributor acknowledgments section (#136)
* citation + acks section

* nits
2023-12-18 10:12:35 -08:00
Daniel Strobusch
f0e14b6341
fix renamed arg (#140) 2023-12-18 10:11:51 -08:00
Awni Hannun
44b546d446
support for tiny llama (#129) 2023-12-18 07:47:55 -08:00
Awni Hannun
08e862336a
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
db134d976d
Merge pull request #115 from ml-explore/lora_custom
Customize dataset with lora
2023-12-15 13:54:58 -08:00
Awni Hannun
8df211869e minimum version 2023-12-15 13:54:31 -08:00
Pawel Kowalski
fc1495abaa
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
86cae9ba57
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
ff0f172363 32 GB example 2023-12-15 12:20:15 -08:00
Awni Hannun
ee2ee0f8e5 32 GB example 2023-12-15 12:18:29 -08:00
Sam Coward
877f88dfea Pass along temp argument to generate() 2023-12-15 15:16:41 -05:00
Awni Hannun
8c8f9d6440 keep base weights in fp16 2023-12-15 10:42:18 -08:00
Awni Hannun
84f02ef58b use lower precision base weights 2023-12-15 10:29:42 -08:00
Awni Hannun
d108c558fc more nits 2023-12-15 10:06:14 -08:00
Awni Hannun
fa51553f09 fix readme 2023-12-15 09:59:07 -08:00
Awni Hannun
985f413f99 custom data with lora 2023-12-15 09:56:10 -08:00
Awni Hannun
126b99d8be
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
71b40c474c
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
ec11763527 fix RoPE bug + minor updates 2023-12-14 21:45:25 -08:00
devonthomas35
d74d9453dd
Refactor EOS check 2023-12-14 21:11:23 -08:00
Awni Hannun
a3ecda22fe
Merge pull request #107 from ml-explore/hf_mixtral
Use official HF for mixtral
2023-12-14 16:57:19 -08:00
Awni Hannun
b863e7cca0 format 2023-12-14 16:56:50 -08:00
devonthomas35
d7d7aabded
Remove unnecessary return 2023-12-14 15:52:22 -08:00
devonthomas35
4549dcbbd0
Stop generating at eos token 2023-12-14 15:50:59 -08:00
Awni Hannun
e434e7e5c2 incude instruct option 2023-12-14 15:40:38 -08:00
Awni Hannun
078fed3d8d use official HF for mixtral 2023-12-14 15:30:32 -08:00
Awni Hannun
67a208b13e
Merge pull request #106 from fahnub/main
minor dependency fix in phi-2
2023-12-14 14:15:19 -08:00
Fahad Nadeem
9b887cef08 minor dep fix in phi 2023-12-15 03:09:33 +05:00
Awni Hannun
09fff84a85
Merge pull request #77 from SarthakYadav/main
Added CIFAR-10 + ResNet example
2023-12-14 12:19:40 -08:00
Awni Hannun
b9439ce74e typo / nits 2023-12-14 12:14:01 -08:00
Awni Hannun
b1b9b11801 updates + format 2023-12-14 12:09:10 -08:00
Awni Hannun
0e88a6afa1
Merge pull request #103 from arpitingle/patch-1
added phi in readme
2023-12-14 10:19:40 -08:00
arpit
5b08da2395
Update README.md 2023-12-14 23:40:50 +05:30
Awni Hannun
92efa32060
Merge pull request #97 from jbarrow/main
Phi-2
2023-12-14 09:21:26 -08:00
Awni Hannun
8f60d60814 cleanup conversion to use single qkv matrix 2023-12-14 09:19:44 -08:00
Awni Hannun
0c1c500714 update readme 2023-12-14 08:37:34 -08:00
Awni Hannun
3d2a23184a change file name for consistency, update readme. 2023-12-14 08:34:24 -08:00
Awni Hannun
840c0c36c2 don't drop last tokens 2023-12-14 08:27:44 -08:00
Awni Hannun
1613e608a9 fix args, update README, remove extra files 2023-12-14 08:18:01 -08:00
Awni Hannun
a8d4149147 fix fp16 + nits 2023-12-14 08:08:28 -08:00
Sarthak Yadav
29b7a97342 updated header 2023-12-14 16:28:00 +01:00
Awni Hannun
b11997122d
Merge pull request #98 from finnless/patch-1
Fix typo in stable_diffusion README
2023-12-14 07:13:19 -08:00
Awni Hannun
363108d7b3
Merge pull request #102 from burakbudanur/main
Corrected the typo in 'ffn_dim_multiplier' in and added 'rope_theta' …
2023-12-14 07:12:20 -08:00
Burak Budanur
f691e00e5a Corrected the typo in 'ffn_dim_multiplier' in and added 'rope_theta' to the list unused. Without these, llama examples did not run. 2023-12-14 14:02:11 +01:00
Sarthak Yadav
15a6c155a8 simplified ResNet, expanded README with throughput and performance 2023-12-14 09:05:04 +01:00
Awni Hannun
88d7b67e6e add cache + generation, clean up some stuff 2023-12-13 22:26:33 -08:00