Downloads · 30 days
3
5% of all-time downloads
bansalaman18/uncased_L-2_H-256_A-4
uncased_L-2_H-256_A-4 is a machine learning model from bansalaman18. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This model is a PyTorch conversion of the original TensorFlow BERT checkpoint.
Downloads · 30 days
3
5% of all-time downloads
All-time downloads
63
Public
Repo size
38.8 MB
Likes
0
Public
Click a slice to open those files.
.bin38.8 MB · 99%
From the Hugging Face model README
This model is a PyTorch conversion of the original TensorFlow BERT checkpoint.
{
"hidden_size": 256,
"hidden_act": "gelu",
"initializer_range": 0.02,
"vocab_size": 30522,
"hidden_dropout_prob": 0.1,
"num_attention_heads": 4,
"type_vocab_size": 2,
"max_position_embeddings": 512,
"num_hidden_layers": 2,
"intermediate_size": 1024,
"attention_probs_dropout_prob": 0.1
}
from transformers import BertForPreTraining, BertTokenizer
# Load the model and tokenizer
model = BertForPreTraining.from_pretrained('bansalaman18/uncased_L-2_H-256_A-4')
tokenizer = BertTokenizer.from_pretrained('bansalaman18/uncased_L-2_H-256_A-4')
# Example usage
text = "Hello, this is a sample text for BERT."
inputs = tokenizer(text, return_tensors='pt')
outputs = model(**inputs)
This model was originally trained on the same data as the standard BERT models:
This model was converted from the original TensorFlow checkpoint to PyTorch format using a custom conversion script with the Hugging Face Transformers library.
@article{devlin2018bert,
title={BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding},
author={Devlin, Jacob and Chang, Ming-Wei and Lee, Kenton and Toutanova, Kristina},
journal={arXiv preprint arXiv:1810.04805},
year={2018}
}