Downloads · 30 days
105
1% of all-time downloads
describeai/gemini
gemini is a machine learning model from describeai. 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 mit.
For in-depth understanding of our model and methods, please see our blog here
Downloads · 30 days
105
1% of all-time downloads
All-time downloads
15K
Public
Repo size
5.9 GB
Likes
43
Public
Click a slice to open those files.
.bin3 GB · 100%
From the Hugging Face model README
For in-depth understanding of our model and methods, please see our blog here
Gemini is a transformer based on Google's T5 model. The model is pre-trained on approximately 800k code/description pairs and then fine-tuned on 10k higher-level explanations that were synthetically generated. Gemini is capable of summarization/explaining short to medium code snippets in:
And outputs a description in English.
Gemini without any additional fine-tuning is capable of explaining code in a sentence or two and typically performs best in Python and Javascript. We recommend using Gemini for either simple code explanation, documentation or producing more synthetic data to improve its explanations.
You can use this model directly with a pipeline for Text2Text generation, as shown below:
from transformers import pipeline, set_seed
summarizer = pipeline('text2text-generation', model='describeai/gemini')
code = "print('hello world!')"
response = summarizer(code, max_length=100, num_beams=3)
print("Summarized code: " + response[0]['generated_text'])
Which should yield something along the lines of:
Summarized code: The following code is greeting the world.
Typically, Gemini may produce overly simplistic descriptions that don't encompass the entire code snippet. We suspect with more training data, this could be circumvented and will produce better results.
A Describe.ai, we are focused on building Artificial Intelligence systems that can understand language as well as humans. While a long path, we plan to contribute our findings to our API to the Open Source community.