Instructions to use Jingya/tiny-random-bert-remote-code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jingya/tiny-random-bert-remote-code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Jingya/tiny-random-bert-remote-code")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Jingya/tiny-random-bert-remote-code") model = AutoModel.from_pretrained("Jingya/tiny-random-bert-remote-code", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 387 Bytes
b05d834 | 1 2 3 4 5 6 7 8 9 10 | # from transformers import AutoConfig
# from modeling.modeling_bert import BertCustomLMHeadModel
# cfg = AutoConfig.from_pretrained("hf-internal-testing/tiny-random-BertModel")
# BertCustomLMHeadModel.register_for_auto_class("AutoModelForSequenceClassification")
# model = BertCustomLMHeadModel(cfg)
# model.save_pretrained("/home/Jingya/hf_internship/tiny-testing-gpt2-remote-code") |