Downloads · 30 days
32
28% of all-time downloads
ashaduzzaman/gpt2-finetuned-codeparrot
gpt2-finetuned-codeparrot is a text generation model from ashaduzzaman. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
32
28% of all-time downloads
All-time downloads
113
Public
Parameters
124M
497 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors497 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of GPT-2 tailored for code generation tasks. It has been adapted to better handle programming-related text through additional training on a dataset of code snippets and documentation.
The gpt2-finetuned-codeparrot is a fine-tuned GPT-2 model that has been specifically trained to improve performance on code generation and related tasks. It leverages the transformer architecture to generate coherent and contextually relevant code based on the input prompts. This model is particularly useful for generating code snippets, assisting with code completion, and providing contextually relevant programming-related information.
The model was fine-tuned on a diverse collection of code snippets and programming-related documents. Details of the dataset, including specific sources and data characteristics, are not provided.
Evaluation metrics and results are not provided. Users should conduct their own evaluations to assess the model's performance on specific tasks or datasets.
Specific training results, such as loss values or performance metrics, are not provided. Users are encouraged to assess the model's performance in their own applications.
import torch
from transformers import pipeline
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
pipe = pipeline(
"text-generation",
model="Ashaduzzaman/gpt2-finetuned-codeparrot",
device=device
)
# Example usage
prompt = "def fibonacci(n):"
generated_code = pipe(prompt, max_length=50, num_return_sequences=1)
print(generated_code[0]['generated_text'])