vikp commited on
Commit
5285311
1 Parent(s): 74a71ec

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +43 -1
README.md CHANGED
@@ -3,4 +3,46 @@ datasets:
3
  - vikp/python_code_instructions_filtered
4
  ---
5
 
6
- Code llama 7b finetuned for 1 epoch on a subset of the python code instructions dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  - vikp/python_code_instructions_filtered
4
  ---
5
 
6
+ Code llama 7b finetuned for 1 epoch on a subset of the python code instructions dataset. Scores `.62` in humaneval with greedy decoding (matched to code llama pass@1).
7
+
8
+ To use in inference, you'll need to set `trust_remote_code = True` to pick up the right rope theta value:
9
+
10
+ ```
11
+ from transformers import AutoModelForCausalLM
12
+ from transformers import AutoTokenizer
13
+
14
+ tokenizer = AutoTokenizer.from_pretrained("vikp/llama_coder")
15
+ model = AutoModelForCausalLM.from_pretrained("vikp/llama_coder", trust_remote_code=True)
16
+
17
+ text = tokenizer.bos_token + """\
18
+ import socket
19
+
20
+ def ping_exponential_backoff(host: str):""".lstrip()
21
+
22
+ tokens = tokenizer(text, return_tensors="pt")
23
+ output = model.generate(**tokens, max_new_tokens=128, do_sample=True, temperature=.1, top_p=1.0)
24
+ print(tokenizer.decode(output[0], skip_special_tokens=True).strip())
25
+ ```
26
+
27
+ You can duplicate benchmark results with the bigcode eval harness:
28
+
29
+ ```
30
+ git clone https://github.com/bigcode-project/bigcode-evaluation-harness.git
31
+ cd bigcode-evaluation-harness
32
+ pip install -e .
33
+ ```
34
+
35
+ ```
36
+ accelerate launch main.py \
37
+ --model vikp/instruct_llama_7b \
38
+ --tasks humaneval \
39
+ --max_length_generation 1024 \
40
+ --temperature 0 \
41
+ --do_sample False \
42
+ --n_samples 1 \
43
+ --precision fp16 \
44
+ --allow_code_execution \
45
+ --save_generations \
46
+ --use_auth_token \
47
+ --trust_remote_code
48
+ ```