Downloads · 30 days
28
1% of all-time downloads
flax-community/gpt-neo-125M-code-clippy-dedup
gpt-neo-125M-code-clippy-dedup is a text generation model from flax-community. Use it when you need the model to write or continue text. It is set up for transformers.
Please refer to our new GitHub Wiki which documents our efforts in detail in creating the open source version of GitHub Copilot
Downloads · 30 days
28
1% of all-time downloads
All-time downloads
1.9K
Public
Repo size
3.1 GB
Likes
0
Public
Click a slice to open those files.
.msgpack2 GB · 79%
From the Hugging Face model README
Please refer to our new GitHub Wiki which documents our efforts in detail in creating the open source version of GitHub Copilot
PT-Neo-125M-Code-Clippy-Dedup is a GPT-Neo-125M model finetuned using causal language modeling on our deduplicated version of the Code Clippy Data dataset, which was scraped from public Github repositories (more information in the provided link). This model is specialized to autocomplete methods in multiple programming languages.
In this model's training we tried to stabilize the training by limiting the types of files we were using to train to only those that contained file extensions for popular programming languages as our dataset contains other types of files as well such as .txt or project configuration files. We used the following extensions to filter by:
The training script used to train this model can be found here.
./run_clm_streaming_filter_flax.py \
--output_dir $HOME/gpt-neo-125M-code-clippy-dedup \
--model_name_or_path="EleutherAI/gpt-neo-125M" \
--dataset_name $HOME/gpt-code-clippy/data_processing/code_clippy_filter.py \
--data_dir $HOME/code_clippy_data/code_clippy_dedup_data \
--text_column_name="text" \
--do_train --do_eval \
--block_size="2048" \
--per_device_train_batch_size="8" \
--per_device_eval_batch_size="16" \
--preprocessing_num_workers="8" \
--learning_rate="1e-4" \
--max_steps 100000 \
--warmup_steps 2000 \
--decay_steps 30000 \
--adam_beta1="0.9" \
--adam_beta2="0.95" \
--weight_decay="0.1" \
--overwrite_output_dir \
--logging_steps="25" \
--eval_steps="500" \
--push_to_hub="False" \
--report_to="all" \
--dtype="bfloat16" \
--skip_memory_metrics="True" \
--save_steps="500" \
--save_total_limit 10 \
--gradient_accumulation_steps 16 \
--report_to="wandb" \
--run_name="gpt-neo-125M-code-clippy-dedup-filtered-no-resize-2048bs" \
--max_eval_samples 2000 \
--save_optimizer true
The model is finetuned text file from github repositories (mostly programming languages but also markdown and other project related files).
You can use this model directly with a pipeline for text generation. This example generates a different sequence each time it's run:
from transformers import AutoModelForCausalLM, AutoTokenizer, FlaxAutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("flax-community/gpt-neo-125M-code-clippy-dedup")
tokenizer = AutoTokenizer.from_pretrained("flax-community/gpt-neo-125M-code-clippy-dedup")
prompt = """def greet(name):
'''A function to greet user. Given a user name it should say hello'''
"""
input_ids = tokenizer(prompt, return_tensors='pt').input_ids.to(device)
start = input_ids.size(1)
out = model.generate(input_ids, do_sample=True, max_length=50, num_beams=2,
early_stopping=True, eos_token_id=tokenizer.eos_token_id, )
print(tokenizer.decode(out[0][start:]))
The model is intended to be used for research purposes and comes with no guarantees of quality of generated code.
The paper "Evaluating Large Language Models Trained on Code" from OpenAI has a good discussion on what the impact of a large language model trained on code could be. Therefore, some parts of their discuss are highlighted here as it pertains to this dataset and models that may be trained from it. As well as some differences in views from the paper, particularly around legal implications.
GPT-Neo-125M-Code-Clippy-Dedup is finetuned from GPT-Neo and might have inherited biases and limitations from it. See GPT-Neo model card for details.
Coming soon...