summaryrefslogtreecommitdiff
path: root/candle-examples/examples/bert/main.rs
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Speed up bert with approx gelu (#1410)Juarez Bochi2023-12-061-2/+9
|
* Handle LongStorage in pytorch checkpoints. (#1152)Laurent Mazare2023-10-221-27/+20
|
* Adapt more examples to the updated safetensor api. (#947)Laurent Mazare2023-09-231-3/+2
| | | | | | | | | * Simplify the safetensor usage. * Convert more examples. * Move more examples. * Adapt stable-diffusion.
* Move some models to candle-transformers so that it's easier to re-use. (#794)Laurent Mazare2023-09-101-2/+1
| | | | | | | | | * Move some models to candle-transformers so that they can be shared. * Also move falcon. * Move Llama. * Move whisper (partial).
* Upgrading hf-hub.Nicolas Patry2023-08-291-4/+4
|
* Add a yolo-v3 example. (#528)Laurent Mazare2023-08-201-0/+3
| | | | | | | | | | | | | | | * Add a couple functions required for yolo. * Add the yolo-v3 example. * Add minimum and maximum. * Use the newly introduced maximum. * Cuda support for min/max + add some testing. * Allow for more tests to work with accelerate. * Fix a typo.
* Add a cuda kernel for upsampling. (#441)Laurent Mazare2023-08-141-1/+4
| | | | | * Add a cuda kernel for upsampling. * Update for the latest tokenizers version.
* Normalize embeddings in the bert example. (#390)Laurent Mazare2023-08-101-0/+14
|
* Upgrading hf-hub to `0.2.0` (Modified API to not pass the Repo aroundNicolas Patry2023-07-271-3/+4
| | | | all the time)
* Rename the .r functions to .dims so as to be a bit more explicit. (#220)Laurent Mazare2023-07-221-1/+1
|
* Removing `candle-hub` internal to extract into `hf-hub` standalone.Nicolas Patry2023-07-191-1/+1
|
* Use mkl to accelerate binary ops. (#190)Laurent Mazare2023-07-181-2/+5
| | | | | | | | | | | * Vectorized binary ops with mkl. * Improve the binary op mkl support. * Push the support for mkl binary ops. * Proper vectorization of binary ops. * Proper mkl'isation when broadcasting binary ops.
* Bert tracing (#184)Laurent Mazare2023-07-171-461/+20
| | | | | | | * Add some tracing to bert. * More tracing. * Add a flag for tracing.
* Add some 'cuda-if-available' helper function. (#172)Laurent Mazare2023-07-151-14/+1
|
* Removing cuda default.Nicolas Patry2023-07-141-1/+10
| | | | | | | Seems very important for a lot of exploring users usually on laptop without GPUs. Adding more README instructions in a follow up.
* Simplify the parameters used by sum and sum_keepdim. (#165)Laurent Mazare2023-07-141-1/+1
|
* Use the same default as pytorch for sum. (#164)Laurent Mazare2023-07-131-4/+4
|
* Tensor mutability (#154)Laurent Mazare2023-07-131-1/+1
| | | | | * Working towards tensor mutability. * Use a ref-cell to provide tensor mutability.
* Remove some dead-code pragmas. (#137)Laurent Mazare2023-07-111-10/+2
|
* VarBuilder path creation (#131)Laurent Mazare2023-07-101-72/+42
| | | | | | | * Use a struct for the safetensor+routing. * Group the path and the var-builder together. * Fix for the empty path case.
* Move the var-builder in a central place. (#130)Laurent Mazare2023-07-101-61/+3
|
* [nn] Move the Embedding and Activation parts. (#116)Laurent Mazare2023-07-101-30/+7
| | | | | * Share the Embedding and Activation parts. * Tweak some activations.
* Sketch the candle-nn crate. (#115)Laurent Mazare2023-07-101-76/+33
| | | | | | | * Sketch the candle-nn crate. * Tweak the cuda dependencies. * More cuda tweaks.
* Merge pull request #92 from LaurentMazare/sync_hubNicolas Patry2023-07-071-8/+7
|\ | | | | Creating new sync Api for `candle-hub`.
| * Creating new sync Api for `candle-hub`.Nicolas Patry2023-07-061-8/+7
| | | | | | | | | | | | - `api::Api` -> `api::tokio::api` (And created new `api::sync::Api`). - Remove `tokio` from all our examples. - Using similar codebase for now instead of ureq (for simplicity).
* | Enabling `roberta` for the example (it's the same model as Bert, withNicolas Patry2023-07-061-8/+26
|/ | | | just different naming.)
* Add mkl support for matrix multiply. (#86)Laurent Mazare2023-07-061-0/+4
| | | | | | | | | | | | | * Fix some rebase issues. * Use mkl instead. * Use mkl in bert. * Add the optional mkl feature. * Conditional compilation based on the mkl feature. * Add more mkl support.
* Add a simpler way to specify the dim index for some ops.laurent2023-07-051-2/+2
|
* Use avg pooling before the cosine similarity.laurent2023-07-051-3/+4
|
* Add some sentence similarity comparision to the bert example.laurent2023-07-051-63/+122
|
* Some polish.Nicolas Patry2023-07-051-7/+11
|
* Adding offline mode.Nicolas Patry2023-07-051-11/+41
|
* Upgrading bert example to work with `bert-base-uncased`.Nicolas Patry2023-07-041-16/+61
| | | | | | | | - Always take weights from the hub - Optional `model_id` + `revision` to use safetensors version potentially - Optional loading for `bert-base-uncased` (`weight` vs `gamma`). - Take the config from the hub.
* Add a batch dimension on the bert example.laurent2023-07-041-11/+15
|
* Allow for batch dimensions in the embedding layer.laurent2023-07-031-6/+14
|
* Minor tweaks.laurent2023-07-031-1/+2
|
* Remove the fixed length hack.laurent2023-07-031-1/+1
|
* Bugfix for transpose.laurent2023-07-031-3/+4
|
* Fix the layer norm to properly handle bias.laurent2023-07-031-11/+30
|
* Get some embeddings out.laurent2023-07-031-14/+23
|
* Get the tensors to be loaded properly.laurent2023-07-031-11/+72
|
* Add the varbuilder + check shapes.laurent2023-07-031-62/+156
|
* Model creation.laurent2023-07-031-6/+134
|
* Complete (?) the forward pass.laurent2023-07-031-2/+28
|
* Add more to the forward pass.laurent2023-07-031-9/+48
|
* Boilerplate code for Bert.laurent2023-07-031-0/+239