mrm8488 / CodeBERTaPy

huggingface.co
Total runs: 65
24-hour runs: 2
7-day runs: 6
30-day runs: 36
Model's Last Updated: May 21 2021
fill-mask

Introduction of CodeBERTaPy

Model Details of CodeBERTaPy

CodeBERTaPy

CodeBERTaPy is a RoBERTa-like model trained on the CodeSearchNet dataset from GitHub for python by Manuel Romero

The tokenizer is a Byte-level BPE tokenizer trained on the corpus using Hugging Face tokenizers .

Because it is trained on a corpus of code (vs. natural language), it encodes the corpus efficiently (the sequences are between 33% to 50% shorter, compared to the same corpus tokenized by gpt2/roberta).

The (small) model is a 6-layer, 84M parameters, RoBERTa-like Transformer model – that’s the same number of layers & heads as DistilBERT – initialized from the default initialization settings and trained from scratch on the full python corpus for 4 epochs.

Quick start: masked language modeling prediction
PYTHON_CODE = """
fruits = ['apples', 'bananas', 'oranges']
for idx, <mask> in enumerate(fruits):
  print("index is %d and value is %s" % (idx, val))
""".lstrip()
Does the model know how to complete simple Python code?
from transformers import pipeline

fill_mask = pipeline(
    "fill-mask",
    model="mrm8488/CodeBERTaPy",
    tokenizer="mrm8488/CodeBERTaPy"
)

fill_mask(PYTHON_CODE)

## Top 5 predictions:

'val' # prob  0.980728805065155
'value'
'idx'
',val'
'_'
Yes! That was easy 🎉 Let's try with another Flask like example
PYTHON_CODE2 = """
@app.route('/<name>')
def hello_name(name):
    return "Hello {}!".format(<mask>)

if __name__ == '__main__':
    app.run()
""".lstrip()


fill_mask(PYTHON_CODE2)

## Top 5 predictions:

'name' # prob  0.9961813688278198
' name'
'url'
'description'
'self'
Yeah! It works 🎉 Let's try with another Tensorflow/Keras like example
PYTHON_CODE3="""
model = keras.Sequential([
    keras.layers.Flatten(input_shape=(28, 28)),
    keras.layers.<mask>(128, activation='relu'),
    keras.layers.Dense(10, activation='softmax')
])
""".lstrip()


fill_mask(PYTHON_CODE3)

## Top 5 predictions:

'Dense' # prob   0.4482928514480591
'relu'
'Flatten'
'Activation'
'Conv'

Great! 🎉

This work is heavily inspired on CodeBERTa by huggingface team

CodeSearchNet citation
@article{husain_codesearchnet_2019,
    title = {{CodeSearchNet} {Challenge}: {Evaluating} the {State} of {Semantic} {Code} {Search}},
    shorttitle = {{CodeSearchNet} {Challenge}},
    url = {http://arxiv.org/abs/1909.09436},
    urldate = {2020-03-12},
    journal = {arXiv:1909.09436 [cs, stat]},
    author = {Husain, Hamel and Wu, Ho-Hsiang and Gazit, Tiferet and Allamanis, Miltiadis and Brockschmidt, Marc},
    month = sep,
    year = {2019},
    note = {arXiv: 1909.09436},
}

Created by Manuel Romero/@mrm8488

Made with ♥ in Spain

Runs of mrm8488 CodeBERTaPy on huggingface.co

65
Total runs
2
24-hour runs
3
3-day runs
6
7-day runs
36
30-day runs

More Information About CodeBERTaPy huggingface.co Model

CodeBERTaPy huggingface.co

CodeBERTaPy huggingface.co is an AI model on huggingface.co that provides CodeBERTaPy's model effect (), which can be used instantly with this mrm8488 CodeBERTaPy model. huggingface.co supports a free trial of the CodeBERTaPy model, and also provides paid use of the CodeBERTaPy. Support call CodeBERTaPy model through api, including Node.js, Python, http.

CodeBERTaPy huggingface.co Url

https://huggingface.co/mrm8488/CodeBERTaPy

mrm8488 CodeBERTaPy online free

CodeBERTaPy huggingface.co is an online trial and call api platform, which integrates CodeBERTaPy's modeling effects, including api services, and provides a free online trial of CodeBERTaPy, you can try CodeBERTaPy online for free by clicking the link below.

mrm8488 CodeBERTaPy online free url in huggingface.co:

https://huggingface.co/mrm8488/CodeBERTaPy

CodeBERTaPy install

CodeBERTaPy is an open source model from GitHub that offers a free installation service, and any user can find CodeBERTaPy on GitHub to install. At the same time, huggingface.co provides the effect of CodeBERTaPy install, users can directly use CodeBERTaPy installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

CodeBERTaPy install url in huggingface.co:

https://huggingface.co/mrm8488/CodeBERTaPy

Url of CodeBERTaPy

CodeBERTaPy huggingface.co Url

Provider of CodeBERTaPy huggingface.co

mrm8488
ORGANIZATIONS

Other API from mrm8488

huggingface.co

Total runs: 855
Run Growth: 264
Growth Rate: 30.88%
Updated:February 23 2024
huggingface.co

Total runs: 106
Run Growth: 3
Growth Rate: 2.83%
Updated:June 20 2023
huggingface.co

Total runs: 73
Run Growth: 33
Growth Rate: 45.21%
Updated:May 21 2021
huggingface.co

Total runs: 72
Run Growth: 32
Growth Rate: 44.44%
Updated:January 24 2024