mav23 commited on
Commit
37d63d4
·
verified ·
1 Parent(s): fc42fbb

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ 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
+ phind-codellama-34b-python-v1.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 69.5%
15
+ verified: false
16
+ tags:
17
+ - code llama
18
+ ---
19
+
20
+ # **Phind-CodeLlama-34B-Python-v1**
21
+ We've fine-tuned CodeLlama-34B and CodeLlama-34B-Python on an internal Phind dataset that achieve 67.6% and 69.5% pass@1 on HumanEval, respectively. GPT-4 achieves 67%. We've applied OpenAI's decontamination methodology to our dataset to ensure result validity.
22
+
23
+ More details can be found on our [blog post](https://www.phind.com/blog/code-llama-beats-gpt4).
24
+
25
+ ## Model Details
26
+ This model is fine-tuned from CodeLlama-34B-Python and achieves 69.5% pass@1 on HumanEval.
27
+
28
+ ## Dataset Details
29
+ We fined-tuned on a proprietary dataset of ~80k high quality programming problems and solutions. This dataset consists of instruction-answer pairs instead of code completion examples, making it structurally different from HumanEval. The Phind models were trained for 2 epochs, for a total of ~160k examples shown. LoRA was not used -- both models are a native finetune. We used DeepSpeed ZeRO 3 and Flash Attention 2 to train these models in three hours on 32 A100-80GB GPUs. We used a sequence length of 4096 tokens.
30
+
31
+ ## How to Get Started with the Model
32
+
33
+ Make sure to install Transformers from the main git branch:
34
+
35
+ ```bash
36
+ pip install git+https://github.com/huggingface/transformers.git
37
+ ```
38
+
39
+ ## How to Prompt the Model
40
+ **Please note that this model is somewhat instruction-tuned, but not chat-tuned.**
41
+
42
+ Do not try to use the Llama chat markup with this model. Instead, simply tell it what you want and add "\n: " at the end of your task.
43
+
44
+ For example:
45
+
46
+ ```
47
+ Write me a linked list implementation: \n
48
+ ```
49
+
50
+ ## How to reproduce HumanEval Results
51
+
52
+ To reproduce our results:
53
+
54
+ ```python
55
+
56
+ from transformers import AutoTokenizer, LlamaForCausalLM
57
+ from human_eval.data import write_jsonl, read_problems
58
+ from tqdm import tqdm
59
+
60
+ # initialize the model
61
+
62
+ model_path = "Phind/Phind-CodeLlama-34B-v1"
63
+ model = LlamaForCausalLM.from_pretrained(model_path, device_map="auto")
64
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
65
+
66
+ # HumanEval helper
67
+
68
+ def generate_one_completion(prompt: str):
69
+ tokenizer.pad_token = tokenizer.eos_token
70
+ inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=4096)
71
+
72
+ # Generate
73
+ generate_ids = model.generate(inputs.input_ids.to("cuda"), max_new_tokens=256, do_sample=True, top_p=0.75, top_k=40, temperature=0.1)
74
+ completion = tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
75
+ completion = completion.replace(prompt, "").split("\n\n\n")[0]
76
+
77
+ return completion
78
+
79
+ # perform HumanEval
80
+ problems = read_problems()
81
+
82
+ num_samples_per_task = 1
83
+ samples = [
84
+ dict(task_id=task_id, completion=generate_one_completion(problems[task_id]["prompt"]))
85
+ for task_id in tqdm(problems)
86
+ for _ in range(num_samples_per_task)
87
+ ]
88
+ write_jsonl("samples.jsonl", samples)
89
+
90
+ # run `evaluate_functional_correctness samples.jsonl` in your HumanEval code sandbox
91
+ ```
92
+
93
+ ## Bias, Risks, and Limitations
94
+
95
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
96
+ This model has undergone very limited testing. Additional safety testing should be performed before any real-world deployments.
97
+
98
+
99
+ ## Training details
100
+
101
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
102
+
103
+ - **Hardware Type:** 32x A100-80GB
104
+ - **Hours used:** 90 GPU-hours
105
+ - **Cloud Provider:** AWS
106
+ - **Compute Region:** us-east-1
phind-codellama-34b-python-v1.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:805a385c4f2cf3268cd31d2ededed162aa7fa95baec5c7df2d87ab2f8a0c31df
3
+ size 19052048960