Enable the image crate by default in examples (#501)

* Enable the image crate by default so that it's easier to compile the stable diffusion example.

* Also update the readme.
This commit is contained in:
Laurent Mazare
2023-08-18 10:00:05 +01:00
committed by GitHub
parent 109e95b189
commit b9661a1c25
2 changed files with 4 additions and 7 deletions

View File

@ -37,10 +37,11 @@ cargo run --example llama --release
cargo run --example falcon --release cargo run --example falcon --release
cargo run --example bert --release cargo run --example bert --release
cargo run --example bigcode --release cargo run --example bigcode --release
cargo run --example stable-diffusion --release --features image -- --prompt "a rusty robot holding a fire torch" cargo run --example stable-diffusion --release -- --prompt "a rusty robot holding a fire torch"
``` ```
In order to use **CUDA** add `--features cuda` to the example command line. In order to use **CUDA** add `--features cuda` to the example command line. If
you have cuDNN installed, use `--features cudnn` for even more speedups.
There are also some wasm examples for whisper and There are also some wasm examples for whisper and
[llama2.c](https://github.com/karpathy/llama2.c). You can either build them with [llama2.c](https://github.com/karpathy/llama2.c). You can either build them with

View File

@ -23,7 +23,7 @@ num-traits = { workspace = true }
intel-mkl-src = { workspace = true, optional = true } intel-mkl-src = { workspace = true, optional = true }
cudarc = { workspace = true, optional = true } cudarc = { workspace = true, optional = true }
half = { workspace = true, optional = true } half = { workspace = true, optional = true }
image = { workspace = true, optional = true } image = { workspace = true }
[dev-dependencies] [dev-dependencies]
anyhow = { workspace = true } anyhow = { workspace = true }
@ -55,7 +55,3 @@ nccl = ["cuda", "cudarc/nccl", "dep:half"]
[[example]] [[example]]
name = "llama_multiprocess" name = "llama_multiprocess"
required-features = ["cuda", "nccl", "flash-attn"] required-features = ["cuda", "nccl", "flash-attn"]
[[example]]
name = "stable-diffusion"
required-features = ["image"]