summaryrefslogtreecommitdiff
path: root/candle-examples/examples
Commit message (Collapse)AuthorAgeFilesLines
* Add the SigLIP model. (#2515)Laurent Mazare2024-09-283-41/+180
| | | | | | | | | | | | | | | | | * Add the SigLIP model. * Add more to the forward pass of the vision model. * Complete the forward pass. * Add the siglip example. * Fix. * Another fix. * Get everything in place. * Add a readme.
* Remove some extra whitelines. (#2513)Laurent Mazare2024-09-281-22/+0
|
* Add some llama-3.2 examples. (#2508)Laurent Mazare2024-09-261-1/+13
| | | | | * Add some llama-3.2 examples. * Support tie-word-embeddings for llama.
* Quantized version of flux. (#2500)Laurent Mazare2024-09-262-20/+65
| | | | | | | | | | | | | * Quantized version of flux. * More generic sampling. * Hook the quantized model. * Use the newly minted gguf file. * Fix for the quantized model. * Default to avoid the faster cuda kernels.
* Add a RotatingKVCache. (#2493)Laurent Mazare2024-09-231-5/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a RotatingKVCache. * Add some KvCache tests. * Test the reset too. * More kv-cache testing. * More tests for the rotating kv-cache. * Improve the api for the rotating cache so that the whole src tensor gets returned when it's overlarge. * Handle contiguity + bugfix + use in mimi. * Add a way to test the mimi streaming mode. * Mimi streaming fixes. * More rotating kv-cache. * Fix the attn mask generation. * Handle the abs case. * Add some tests for the generated mask.
* Adding Granite 7b Instruct model example (#2487)Juan Gomez2024-09-212-0/+271
| | | | | | | | | | | | | | | * Adding Granite 7b Instruct model example * Minor refactoring to make it a little more idiomatic * Clippy fixes. * * Adding a README with some information about supported Granite models * Changing the default prompt to accomodate better the Language modality of the Granite 7b Instruct model --------- Co-authored-by: Laurent <laurent.mazare@gmail.com>
* Add the mimi audio-tokenizer. (#2488)Laurent Mazare2024-09-203-0/+426
| | | | | | | | | | | | | | | * Add the mimi audio-tokenizer. * Formatting tweaks. * Add a full example. * Use the transformers names. * More renamings. * Get encoding and decoding to work. * Clippy fixes.
* Clippy fixes for 1.81.0. (#2461)Laurent Mazare2024-09-054-8/+7
| | | | | * Clippy fixes for 1.81.0. * Another fix.
* Fix FLUX.1 weights (#2457)Eugene Hauptmann2024-08-291-3/+3
| | | | | * fix FLUX.1 weights * added flux1-dev.safetensors
* MobileCLIP models S1 and S2 (#2454)Jani Monoses2024-08-293-2/+223
| | | | | | | | | | | | | * Allow loading images with given std and mean * OpenCLIP text encoder component * Two MobileCLIP models * Clippy fixes. --------- Co-authored-by: Laurent <laurent.mazare@gmail.com>
* FastViT fixes. (#2452)Jani Monoses2024-08-281-5/+5
| | | | | * correct optional SE layer dimensions. * head_dim instead of num_heads is 32. * update test example output.
* Add FastViT model. (#2444)Jani Monoses2024-08-232-0/+122
|
* Fix for parler-tts, do not add the last slice of padding tokens. (#2442)Laurent Mazare2024-08-221-2/+21
| | | | | * Fix for parler-tts, do not add the last slice of padding tokens. * Support for the mini model.
* silero-vad v5 example (#2321)shua2024-08-222-0/+212
| | | | | | | | | | | | | * silero-vad v5 example This change adds an example of how to run silero-vad v5 * PR: rename 'vad' to 'silero-vad' * Update README.md --------- Co-authored-by: Laurent Mazare <laurent.mazare@gmail.com>
* Update README.md (#2435)Laurent Mazare2024-08-191-1/+3
|
* Add a readme for the parler-tts example. (#2434)Laurent Mazare2024-08-193-30/+21
| | | | | | | | | * Add a readme for the parler-tts example. * Remove the python decode script. * mp4 tweaks. * Another readme tweak.
* Add the DAC model. (#2433)Laurent Mazare2024-08-192-7/+20
| | | | | | | | | * Add the DAC model. * More quantization support. * Handle DAC decoding. * Plug the DAC decoding in parler-tts.
* parler-tts support (#2431)Laurent Mazare2024-08-182-0/+204
| | | | | | | | | | | | | | | | | | | | | | | * Start sketching parler-tts support. * Implement the attention. * Add the example code. * Fix the example. * Add the description + t5 encode it. * More of the parler forward pass. * Fix the positional embeddings. * Support random sampling in generation. * Handle EOS. * Add the python decoder. * Proper causality mask.
* Fix the marian tokenizer importer. (#2426)Laurent Mazare2024-08-171-4/+16
| | | | | * Fix the marian tokenizer importer. * Ignore the python caches.
* Add support for gemma-2. (#2425)Laurent Mazare2024-08-172-22/+74
| | | | | | | | | | | * Add gemma-2. * Support a couple more models. * Sliding window support. * Example + readme updates. * Update the main readme.
* Apply rustfmt. (#2421)Laurent Mazare2024-08-161-1/+0
|
* Fix build issue in EOS Token in llama-multiprocess (#2420)Hadi2024-08-161-2/+11
|
* Add Based LLM from Hazy Research. (#2411)Jani Monoses2024-08-122-0/+295
|
* Fix issues in the encodec example README.md (#2407)Joel Nises2024-08-102-1/+1
| | | Also squeeze the first dimension of the codes tensor in the example file to get the expected three dimensions.
* Add the import script for the T5 tokenizer. (#2399)Laurent Mazare2024-08-051-0/+6
|
* add models support and example for THUDM/glm-4 (#2362)唐璜2024-08-052-0/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add models support and example for THUDM/glm-4 * fix the ci report * fmt * fix * Update README.org * Update README.org * fmt * Update README.org * README.md add codegeex4 * README.md add glm4 * Typo. * change expect into ? --------- Co-authored-by: Laurent Mazare <laurent.mazare@gmail.com>
* Support for mistral-nemo. (#2396)Laurent Mazare2024-08-041-7/+14
|
* Support the flux-dev model too. (#2395)Laurent Mazare2024-08-041-9/+37
|
* Add the flux model for image generation. (#2390)Laurent Mazare2024-08-043-0/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add the flux autoencoder. * Add the encoder down-blocks. * Upsampling in the decoder. * Sketch the flow matching model. * More flux model. * Add some of the positional embeddings. * Add the rope embeddings. * Add the sampling functions. * Add the flux example. * Fix the T5 bits. * Proper T5 tokenizer. * Clip encoder path fix. * Get the clip embeddings. * No configurable weights in layer norm. * More weights related fixes. * Yet another shape fix. * DType fix. * Fix a couple more shape issues. * DType fixes. * Fix the latent dims. * Fix more shape issues. * Autoencoder fixes. * Get some generations out. * Bugfix. * T5 padding. * Clippy fix. * Add the decode only mode. * Fix. * More fixes. * Finally get some generations to work. * Add readme.
* Fix cargo fmt. (#2383)Laurent Mazare2024-08-011-14/+19
| | | | | | | * Fix cargo fmt. * Clippy fix. * Cosmetic tweaks.
* Jina Bert Example fix and more configuration (#2191)Joan Fontanals2024-08-011-12/+28
| | | | | | | * fix: fix jina bert example logic * feat: enable jina embeddings de * feat: allow more flexibility on Jina Bert
* Add Hiera vision model. (#2382)Jani Monoses2024-08-012-0/+117
|
* Enable BF16 on metal. (#2380)Laurent Mazare2024-08-011-4/+2
|
* Use BF16 on metal when possible. (#2378)Laurent Mazare2024-08-011-5/+1
|
* bert attention mask (#1934)Zheng Li2024-08-011-2/+10
| | | | | | | | | | | | | | | * bert attention mask * Allow for using None as a mask. * Revert part of the changes so that the proper default mask applies. * Cosmetic change. * Another cosmetic tweak. --------- Co-authored-by: Laurent <laurent.mazare@gmail.com>
* Add support for Llama 3.1 (#2359)Eric Buehler2024-07-262-7/+25
| | | | | | | | | | | | | | | | | * Add Llama 3.1 rope * Clippy * Format * Clippy * Add support for multiple eos tokens: * Untagged either * Remove either dep and fix settings.json * Make the max positional embeddings configurable
* onnx: fix pad, unsqueeze (#2317)shua2024-07-2311-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * onnx: fix pad, unsqueeze both implementations have off-by-one errors: - Pad 'reflect' cycle for eg `dim==3` is `[0,1,2,1]` which has length of 4 (or `dim*2 - 2`) not 5 (current code `dim*2 - 1`) - Unsqueeze(-1) for tensor with `dim==3` should be 3 (ie `dim+index+1`) not 2 (ie currently `dim+index`) in addition, Pad is incorrectly calculating the starting padding. If we want to pad out 2 elements to the start, and we have this cycle of indices of length 6, then we should skip 4 elements, but currently we skip 2. A more visual representation of what's going on is below: ``` pad_start: 2 data: [a,b,c,d] indices: [0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, ..] // zigzag between 0..4 actual: skip [ c d| c b a b] expected: ~ skip ~ [ c b| a b c d] ``` The values between `[` and `|` are padding and the values between `|` and `]` in the example should match the original data being padded. * Fix clippy lints. --------- Co-authored-by: Laurent <laurent.mazare@gmail.com>
* fix clip example title (#2345)Caio Petrucci Rosa2024-07-231-1/+1
|
* feat(candle-transformers/models/codegeex4-9b): add codegeex4-9 (#2334)donjuanplatinum2024-07-212-0/+348
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat(candle-transformers/models/codegeex4-9b): add codegeex4-9b transoformers * change mod.rs * feat(candle-examples/codegeex4-9b) * Update codegeex4_9b.rs * Update main.rs * Update codegeex4_9b.rs * Update main.rs * fmt * fix * fmt * Clippy fix. * Remove some print statements. * Avoid using unwrap. * 1. add README 2. change the print fmt * Another clippy fix. --------- Co-authored-by: Laurent <laurent.mazare@gmail.com>
* Pin the revision used by moondream. (#2340)Laurent Mazare2024-07-181-7/+15
|
* Add mathstral in the examples. (#2339)Laurent Mazare2024-07-181-0/+3
|
* add quantized qwen2 (#2329)Zhuo Jinggang2024-07-122-0/+317
| | | | | * add quantized version of qwen2 and corresponding example for qwen2-instruct * fix quantized qwen2 clippy error
* Add Mobilenet v4 (#2325)Jani Monoses2024-07-092-0/+124
| | | | | | | * Support different resolutions in load_image() * Added MobilenetV4 model. * Add MobileNetv4 to README
* Add EVA-02 model ( https://arxiv.org/abs/2303.11331 ) (#2311)v-espitalier2024-07-072-0/+103
| | | | | | | | | | | | * Add EVA-02 model ( https://arxiv.org/abs/2303.11331 ) * Clippy fix. * And apply fmt. --------- Co-authored-by: v-espitalier <> Co-authored-by: Laurent <laurent.mazare@gmail.com>
* Beit: Add the gen_relative_position_index() function (#2306)v-espitalier2024-07-041-1/+1
| | | Co-authored-by: v-espitalier <>
* Add Beit model ( https://arxiv.org/abs/2106.08254 ) (#2305)v-espitalier2024-07-012-0/+99
| | | Co-authored-by: v-espitalier <>
* make up for the missing last token output of phi2 example (#2299)Czxck0012024-06-291-0/+4
|
* Add DINOv2Reg4 + PlantCLEF2024 (#2293)v-espitalier2024-06-292-0/+95
| | | | | | | | | | | | | | | | | | | | * Add: DINOv2Reg4 with PlantCLEF2024 weights and example ( See https://arxiv.org/abs/2309.16588 and https://zenodo.org/records/10848263 ) * Remove extra files + update README to download them + remove extra lines * minor fix (README remove extra spaces) * minor fix (README: Fix image url) * Modif: Add back interpolate_pos_encoding() + fix when no interpolation + remove extra comments + Update README ( source image changed and so the predictions ) * Fix: Improve code lisibility with '$ cargo clippy' and '$ cargo fmt' * Another clippy fix. --------- Co-authored-by: x-VEspit <vincent.espitalier@cirad.fr> Co-authored-by: laurent <laurent.mazare@gmail.com>
* Depth Anything v2 (#2279)Jeroen Vlek2024-06-243-0/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * define structs * construct ResidualConvUnit * forward() for ResidualConvUnit * implement FeatureFusionBlock * implement Scratch * implement DPTHead * add identity module * implement forward for DTPHead * add get_intermediate_layers to DinoVisionTransformer * implement DepthAnythingV2 * some minor tweaks * fix compile errors * fix var builder prefixes * setup initial example * use fixed patch size of 37 (518 / 14) * debugged until output * print min and max values * add some dynamism to the output location * scale input image * extract prep function * extract output path function * normalize image with magic mean and std * add spectral coloring * squeeze in the right place * make enterpolation optional * use bail instead of panic * omit unnecessary Shape call * remove empty curly braces * use bail instead of assert * use vb and pp * remove closures * extract config object * Apply rustfmt. * Fix some clippy lints. * More lints. * Use the array methods. --------- Co-authored-by: laurent <laurent.mazare@gmail.com>
* Support for the new Qwen2 models. (#2257)Laurent Mazare2024-06-071-10/+26
| | | | | * Support for the new Qwen2 models. * Add more models.