From 49fa184a35f8a6d7ac566f92e2540e21cc01c3d9 Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Fri, 29 Sep 2023 12:50:50 +0200 Subject: [PATCH] Mistral readme (#994) * Mistral: print the generated text. * Add mistral to the readmes. --- README.md | 3 ++ candle-examples/examples/mistral/README.md | 37 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 candle-examples/examples/mistral/README.md diff --git a/README.md b/README.md index 718f4652..9175f73c 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,8 @@ We also provide a some command line based examples using state of the art models - [LLaMA and LLaMA-v2](./candle-examples/examples/llama/): general LLM. - [Falcon](./candle-examples/examples/falcon/): general LLM. - [Phi-v1.5](./candle-examples/examples/phi/): a 1.3b general LLM with performance on par with LLaMA-v2 7b. +- [Mistral7b-v0.1](./candle-examples/examples/mistral/): a 7b general LLM with + performance larger than all publicly available 13b models as of 2023-09-28. - [StarCoder](./candle-examples/examples/bigcode/): LLM specialized to code generation. - [Quantized LLaMA](./candle-examples/examples/quantized/): quantized version of the LLaMA model using the same quantization techniques as @@ -149,6 +151,7 @@ If you have an addition to this list, please submit a pull request. - Falcon. - StarCoder. - Phi v1.5. + - Mistral 7b v0.1. - T5. - Bert. - Whisper (multi-lingual support). diff --git a/candle-examples/examples/mistral/README.md b/candle-examples/examples/mistral/README.md new file mode 100644 index 00000000..a4a1896d --- /dev/null +++ b/candle-examples/examples/mistral/README.md @@ -0,0 +1,37 @@ +# candle-mistral: 7b LLM with Apache 2.0 license weights + +- [Announcement Blog Post](https://mistral.ai/news/announcing-mistral-7b/). +- [Model card](https://huggingface.co/mistralai/Mistral-7B-v0.1) on the + HuggingFace Hub. + +```bash +$ cargo run --example mistral --release --features cuda -- --prompt 'Write helloworld code in Rust' --sample-len 150 + +Generated text: +Write helloworld code in Rust +============================= + +This is a simple example of how to write "Hello, world!" program in Rust. + +## Compile and run + +``bash +$ cargo build --release + Compiling hello-world v0.1.0 (/home/user/rust/hello-world) + Finished release [optimized] target(s) in 0.26s +$ ./target/release/hello-world +Hello, world! +`` + +## Source code + +``rust +fn main() { + println!("Hello, world!"); +} +`` + +## License + +This example is released under the terms +```