Download configuration_bert.py from quietflamingo/dnaberts-no-flashattention: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/quietflamingo/dnaberts-no-flashattention/resolve/main/configuration_bert.py
- Command line
-
hf download hf://quietflamingo/dnaberts-no-flashattention/configuration_bert.py
-
curl -L -o configuration_bert.py https://huggingface.co/quietflamingo/dnaberts-no-flashattention/resolve/main/configuration_bert.py
1.02 kB
| # Copyright 2022 MosaicML Examples authors | |
| # SPDX-License-Identifier: Apache-2.0 | |
| from transformers import BertConfig as TransformersBertConfig | |
| class BertConfig(TransformersBertConfig): | |
| def __init__( | |
| self, | |
| alibi_starting_size: int = 512, | |
| attention_probs_dropout_prob: float = 0.0, | |
| **kwargs, | |
| ): | |
| """Configuration class for MosaicBert. | |
| Args: | |
| alibi_starting_size (int): Use `alibi_starting_size` to determine how large of an alibi tensor to | |
| create when initializing the model. You should be able to ignore this parameter in most cases. | |
| Defaults to 512. | |
| attention_probs_dropout_prob (float): By default, turn off attention dropout in Mosaic BERT | |
| (otherwise, Flash Attention will be off by default). Defaults to 0.0. | |
| """ | |
| super().__init__( | |
| attention_probs_dropout_prob=attention_probs_dropout_prob, **kwargs) | |
| self.alibi_starting_size = alibi_starting_size | |