Downloads · 30 days
6
2% of all-time downloads
jwlovetea/test_model
test_model is a machine learning model from jwlovetea. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
CodeT5-small model, fine-tuned on the code summarization subtask of CodeXGLUE (Ruby programming language). This model can generate a docstring of a given function written in Ruby.
Downloads · 30 days
6
2% of all-time downloads
All-time downloads
247
Public
Parameters
60.5M
484 MB on disk
Likes
0
Public
Click a slice to open those files.
.bin242 MB · 50%
From the Hugging Face model README
CodeT5-small model, fine-tuned on the code summarization subtask of CodeXGLUE (Ruby programming language). This model can generate a docstring of a given function written in Ruby.
The notebook that I used to fine-tune CodeT5 can be found here.
Here's how to use this model:
from transformers import RobertaTokenizer, T5ForConditionalGeneration
model_name = "nielsr/codet5-small-code-summarization-ruby"
tokenizer = RobertaTokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)
code = """
def update_with_file_contents(digest, filename)
File.open(filename) do |io|
while (chunk = io.read(1024 * 8))
digest.update(chunk)
end
end
end
"""
input_ids = tokenizer(code, return_tensors="pt").input_ids
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# Update the digest with the contents of the given file