Remove leftovers
Browse files- .gitattributes +8 -0
- 4.8/README.md +0 -115
- 4.8/config.json +0 -26
- 4.8/generation_config.json +0 -6
- 4.8/special_tokens_map.json +0 -24
- 4.8/tokenizer.model +0 -3
- 4.8/tokenizer_config.json +0 -37
.gitattributes
CHANGED
|
@@ -33,3 +33,11 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
pytorch_model-00006-of-00007.bin filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
pytorch_model-00007-of-00007.bin filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
pytorch_model.bin.index.json filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
pytorch_model-00001-of-00007.bin filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
pytorch_model-00002-of-00007.bin filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
pytorch_model-00003-of-00007.bin filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
pytorch_model-00004-of-00007.bin filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
pytorch_model-00005-of-00007.bin filter=lfs diff=lfs merge=lfs -text
|
4.8/README.md
DELETED
|
@@ -1,115 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: llama2
|
| 3 |
-
model-index:
|
| 4 |
-
- name: Phind-CodeLlama-34B-v1
|
| 5 |
-
results:
|
| 6 |
-
- task:
|
| 7 |
-
type: text-generation
|
| 8 |
-
dataset:
|
| 9 |
-
type: openai_humaneval
|
| 10 |
-
name: HumanEval
|
| 11 |
-
metrics:
|
| 12 |
-
- name: pass@1
|
| 13 |
-
type: pass@1
|
| 14 |
-
value: 73.8%
|
| 15 |
-
verified: false
|
| 16 |
-
tags:
|
| 17 |
-
- code llama
|
| 18 |
-
---
|
| 19 |
-
|
| 20 |
-
# **Phind-CodeLlama-34B-v2**
|
| 21 |
-
We've fine-tuned Phind-CodeLlama-34B-v1 on an additional 1.5B tokens high-quality programming-related data, achieving **73.8% pass@1** on HumanEval. It's the current state-of-the-art amongst open-source models.
|
| 22 |
-
|
| 23 |
-
Furthermore, this model is **instruction-tuned** on the Alpaca/Vicuna format to be steerable and easy-to-use.
|
| 24 |
-
|
| 25 |
-
More details can be found on our [blog post](https://www.phind.com/blog/code-llama-beats-gpt4).
|
| 26 |
-
|
| 27 |
-
## Model Details
|
| 28 |
-
This model is fine-tuned from Phind-CodeLlama-34B-v1 and achieves **73.8% pass@1** on HumanEval.
|
| 29 |
-
|
| 30 |
-
Phind-CodeLlama-34B-v2 is **multi-lingual** and is proficient in Python, C/C++, TypeScript, Java, and more.
|
| 31 |
-
|
| 32 |
-
## Dataset Details
|
| 33 |
-
We fined-tuned on a proprietary dataset of 1.5B tokens of high quality programming problems and solutions. This dataset consists of instruction-answer pairs instead of code completion examples, making it structurally different from HumanEval. LoRA was not used -- both models are a native finetune. We used DeepSpeed ZeRO 3 and Flash Attention 2 to train these models in 15 hours on 32 A100-80GB GPUs. We used a sequence length of 4096 tokens.
|
| 34 |
-
|
| 35 |
-
## How to Get Started with the Model
|
| 36 |
-
|
| 37 |
-
Make sure to install Transformers from the main git branch:
|
| 38 |
-
|
| 39 |
-
```bash
|
| 40 |
-
pip install git+https://github.com/huggingface/transformers.git
|
| 41 |
-
```
|
| 42 |
-
|
| 43 |
-
## How to Prompt the Model
|
| 44 |
-
This model accepts the Alpaca/Vicuna instruction format.
|
| 45 |
-
|
| 46 |
-
For example:
|
| 47 |
-
|
| 48 |
-
```
|
| 49 |
-
### System Prompt
|
| 50 |
-
You are an intelligent programming assistant.
|
| 51 |
-
|
| 52 |
-
### User Message
|
| 53 |
-
Implement a linked list in C++
|
| 54 |
-
|
| 55 |
-
### Assistant
|
| 56 |
-
...
|
| 57 |
-
```
|
| 58 |
-
|
| 59 |
-
## How to reproduce HumanEval Results
|
| 60 |
-
|
| 61 |
-
To reproduce our results:
|
| 62 |
-
|
| 63 |
-
```python
|
| 64 |
-
|
| 65 |
-
from transformers import AutoTokenizer, LlamaForCausalLM
|
| 66 |
-
from human_eval.data import write_jsonl, read_problems
|
| 67 |
-
from tqdm import tqdm
|
| 68 |
-
|
| 69 |
-
# initialize the model
|
| 70 |
-
|
| 71 |
-
model_path = "Phind/Phind-CodeLlama-34B-v2"
|
| 72 |
-
model = LlamaForCausalLM.from_pretrained(model_path, device_map="auto")
|
| 73 |
-
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 74 |
-
|
| 75 |
-
# HumanEval helper
|
| 76 |
-
|
| 77 |
-
def generate_one_completion(prompt: str):
|
| 78 |
-
tokenizer.pad_token = tokenizer.eos_token
|
| 79 |
-
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=4096)
|
| 80 |
-
|
| 81 |
-
# Generate
|
| 82 |
-
generate_ids = model.generate(inputs.input_ids.to("cuda"), max_new_tokens=384, do_sample=True, top_p=0.75, top_k=40, temperature=0.1)
|
| 83 |
-
completion = tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
| 84 |
-
completion = completion.replace(prompt, "").split("\n\n\n")[0]
|
| 85 |
-
|
| 86 |
-
return completion
|
| 87 |
-
|
| 88 |
-
# perform HumanEval
|
| 89 |
-
problems = read_problems()
|
| 90 |
-
|
| 91 |
-
num_samples_per_task = 1
|
| 92 |
-
samples = [
|
| 93 |
-
dict(task_id=task_id, completion=generate_one_completion(problems[task_id]["prompt"]))
|
| 94 |
-
for task_id in tqdm(problems)
|
| 95 |
-
for _ in range(num_samples_per_task)
|
| 96 |
-
]
|
| 97 |
-
write_jsonl("samples.jsonl", samples)
|
| 98 |
-
|
| 99 |
-
# run `evaluate_functional_correctness samples.jsonl` in your HumanEval code sandbox
|
| 100 |
-
```
|
| 101 |
-
|
| 102 |
-
## Bias, Risks, and Limitations
|
| 103 |
-
|
| 104 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 105 |
-
This model has undergone very limited testing. Additional safety testing should be performed before any real-world deployments.
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
## Training details
|
| 109 |
-
|
| 110 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 111 |
-
|
| 112 |
-
- **Hardware Type:** 32x A100-80GB
|
| 113 |
-
- **Hours used:** 480 GPU-hours
|
| 114 |
-
- **Cloud Provider:** AWS
|
| 115 |
-
- **Compute Region:** us-east-1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.8/config.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"_name_or_path": "/fsx/Phind-CodeLlama-34B-v1",
|
| 3 |
-
"architectures": [
|
| 4 |
-
"LlamaForCausalLM"
|
| 5 |
-
],
|
| 6 |
-
"bos_token_id": 1,
|
| 7 |
-
"eos_token_id": 2,
|
| 8 |
-
"hidden_act": "silu",
|
| 9 |
-
"hidden_size": 8192,
|
| 10 |
-
"initializer_range": 0.02,
|
| 11 |
-
"intermediate_size": 22016,
|
| 12 |
-
"max_position_embeddings": 16384,
|
| 13 |
-
"model_type": "llama",
|
| 14 |
-
"num_attention_heads": 64,
|
| 15 |
-
"num_hidden_layers": 48,
|
| 16 |
-
"num_key_value_heads": 8,
|
| 17 |
-
"pretraining_tp": 1,
|
| 18 |
-
"rms_norm_eps": 1e-05,
|
| 19 |
-
"rope_scaling": null,
|
| 20 |
-
"rope_theta": 1000000,
|
| 21 |
-
"tie_word_embeddings": false,
|
| 22 |
-
"torch_dtype": "bfloat16",
|
| 23 |
-
"transformers_version": "4.33.0.dev0",
|
| 24 |
-
"use_cache": true,
|
| 25 |
-
"vocab_size": 32000
|
| 26 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.8/generation_config.json
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"_from_model_config": true,
|
| 3 |
-
"bos_token_id": 1,
|
| 4 |
-
"eos_token_id": 2,
|
| 5 |
-
"transformers_version": "4.33.0.dev0"
|
| 6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.8/special_tokens_map.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"bos_token": {
|
| 3 |
-
"content": "<s>",
|
| 4 |
-
"lstrip": false,
|
| 5 |
-
"normalized": true,
|
| 6 |
-
"rstrip": false,
|
| 7 |
-
"single_word": false
|
| 8 |
-
},
|
| 9 |
-
"eos_token": {
|
| 10 |
-
"content": "</s>",
|
| 11 |
-
"lstrip": false,
|
| 12 |
-
"normalized": true,
|
| 13 |
-
"rstrip": false,
|
| 14 |
-
"single_word": false
|
| 15 |
-
},
|
| 16 |
-
"pad_token": "</s>",
|
| 17 |
-
"unk_token": {
|
| 18 |
-
"content": "<unk>",
|
| 19 |
-
"lstrip": false,
|
| 20 |
-
"normalized": true,
|
| 21 |
-
"rstrip": false,
|
| 22 |
-
"single_word": false
|
| 23 |
-
}
|
| 24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4.8/tokenizer.model
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
| 3 |
-
size 499723
|
|
|
|
|
|
|
|
|
|
|
|
4.8/tokenizer_config.json
DELETED
|
@@ -1,37 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"add_bos_token": true,
|
| 3 |
-
"add_eos_token": false,
|
| 4 |
-
"bos_token": {
|
| 5 |
-
"__type": "AddedToken",
|
| 6 |
-
"content": "<s>",
|
| 7 |
-
"lstrip": false,
|
| 8 |
-
"normalized": true,
|
| 9 |
-
"rstrip": false,
|
| 10 |
-
"single_word": false
|
| 11 |
-
},
|
| 12 |
-
"clean_up_tokenization_spaces": false,
|
| 13 |
-
"eos_token": {
|
| 14 |
-
"__type": "AddedToken",
|
| 15 |
-
"content": "</s>",
|
| 16 |
-
"lstrip": false,
|
| 17 |
-
"normalized": true,
|
| 18 |
-
"rstrip": false,
|
| 19 |
-
"single_word": false
|
| 20 |
-
},
|
| 21 |
-
"legacy": null,
|
| 22 |
-
"model_max_length": 4096,
|
| 23 |
-
"pad_token": null,
|
| 24 |
-
"padding_side": "right",
|
| 25 |
-
"sp_model_kwargs": {},
|
| 26 |
-
"spaces_between_special_tokens": false,
|
| 27 |
-
"tokenizer_class": "LlamaTokenizer",
|
| 28 |
-
"unk_token": {
|
| 29 |
-
"__type": "AddedToken",
|
| 30 |
-
"content": "<unk>",
|
| 31 |
-
"lstrip": false,
|
| 32 |
-
"normalized": true,
|
| 33 |
-
"rstrip": false,
|
| 34 |
-
"single_word": false
|
| 35 |
-
},
|
| 36 |
-
"use_default_system_prompt": true
|
| 37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|