Views
No views yet
Please refer to our new GitHub Wiki which documents our efforts in detail in creating the open source version of GitHub Copilot
["\t\t", " ", " ", " "] and since they are all related to indentation, we initialize the embedding layer of these tokens with the same weights as the \t token already present in the model in hopes the model will learn to associate these whitespace characters with indentation faster. A script to automatically do this can be found here.1./run_clm_streaming_flax_v2.py \
2 --output_dir $HOME/gpt-neo-125M-code-clippy-from-scratch \
3 --tokenizer_name="EleutherAI/gpt-neo-125M" \
4 --model_name_or_path="EleutherAI/gpt-neo-125M" \
5 --dataset_name $HOME/gpt-code-clippy/data_processing/code_clippy.py \
6 --data_dir /home/shared/code_clippy_data \
7 --do_train --do_eval \
8 --block_size="2048" \
9 --per_device_train_batch_size="8" \
10 --per_device_eval_batch_size="16" \
11 --preprocessing_num_workers="8" \
12 --learning_rate="3e-5" \
13 --max_steps 100000 \
14 --warmup_steps 2500\
15 --decap_steps 25000 \
16 --adam_beta1="0.9" \
17 --adam_beta2="0.95" \
18 --weight_decay="0.1" \
19 --overwrite_output_dir \
20 --logging_steps="50" \
21 --eval_steps="500" \
22 --push_to_hub="False" \
23 --report_to="all" \
24 --dtype="bfloat16" \
25 --skip_memory_metrics="True" \
26 --save_steps="500" \
27 --save_total_limit 10 \
28 --report_to="wandb" \
29 --run_name="gpt-neo-125M-code-clippy-dedup-scratch"1
2from transformers import AutoModelForCausalLM, AutoTokenizer, FlaxAutoModelForCausalLM
3
4model = AutoModelForCausalLM.from_pretrained("flax-community/gpt-neo-125M-code-clippy-dedup-scratch")
5
6tokenizer = AutoTokenizer.from_pretrained("flax-community/gpt-neo-125M-code-clippy-dedup-scratch")
7
8prompt = """def greet(name):
9 '''A function to greet user. Given a user name it should say hello'''
10"""
11
12input_ids = tokenizer(prompt, return_tensors='pt').input_ids.to(device)
13
14start = input_ids.size(1)
15
16out = model.generate(input_ids, do_sample=True, max_length=50, num_beams=2,
17
18 early_stopping=True, eos_token_id=tokenizer.eos_token_id, )
19
20print(tokenizer.decode(out[0][start:]))
21| Model | Dataset Used | pass@1 | pass@2 | pass@5 | pass@10 |
|---|---|---|---|---|---|
| gpt-neo-125M (trained from scratch) | Code Clippy Data (Deduplicated) (~1% of the data) | 0.00% | 0.00% | 0.00% | 0.00% |