From 9d3ee016c938738cdba705e3b37be56ceee0887b Mon Sep 17 00:00:00 2001 From: Juarez Bochi Date: Mon, 18 Dec 2023 08:50:36 -0500 Subject: [PATCH] Add readme.md for t5 --- t5/README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 t5/README.md diff --git a/t5/README.md b/t5/README.md new file mode 100644 index 00000000..5b173d42 --- /dev/null +++ b/t5/README.md @@ -0,0 +1,29 @@ +# T5 + +[T5](https://arxiv.org/pdf/1910.10683.pdf) are encoder-decoder models pre-trained on a multi-task mixture of unsupervised and supervised tasks. T5 works well on a variety of tasks out-of-the-box by prepending a different prefix to the input corresponding to each task, e.g.: `translate English to German: …`, `summarize: ….` + +## Setup + +Download and convert the model: + +```sh +python convert.py --model t5-small +``` + +This will make the `{model}.npz` file which MLX can read. + +## Generate + +To run the model, use the `t5.py` script: + +```sh +python t5.py --model t5-small --prompt "translate English to German: A tasty apple" +``` + +Should give the output: `Ein schmackhafter Apfel` + +To see a list of options run: + +```sh +python t5.py --help +```