Run this model with HF Jobs
Run microsoft/codebert-base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/microsoft/codebert-base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/microsoft/codebert-base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use microsoft/codebert-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/codebert-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="microsoft/codebert-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("microsoft/codebert-base") model = AutoModel.from_pretrained("microsoft/codebert-base", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
|
Download README.md from microsoft/codebert-base: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/microsoft/codebert-base/resolve/main/README.md
- Command line
-
hf download hf://microsoft/codebert-base/README.md
-
curl -L -o README.md https://huggingface.co/microsoft/codebert-base/resolve/main/README.md
1.22 kB
CodeBERT-base
Pretrained weights for CodeBERT: A Pre-Trained Model for Programming and Natural Languages.
Training Data
The model is trained on bi-modal data (documents & code) of CodeSearchNet
Training Objective
This model is initialized with Roberta-base and trained with MLM+RTD objective (cf. the paper).
Usage
Please see the official repository for scripts that support "code search" and "code-to-document generation".
Reference
- CodeBERT trained with Masked LM objective (suitable for code completion)
- 🤗 Hugging Face's CodeBERTa (small size, 6 layers)
Citation
@misc{feng2020codebert,
title={CodeBERT: A Pre-Trained Model for Programming and Natural Languages},
author={Zhangyin Feng and Daya Guo and Duyu Tang and Nan Duan and Xiaocheng Feng and Ming Gong and Linjun Shou and Bing Qin and Ting Liu and Daxin Jiang and Ming Zhou},
year={2020},
eprint={2002.08155},
archivePrefix={arXiv},
primaryClass={cs.CL}
}