mwitiderrick
commited on
Commit
·
4437aa5
1
Parent(s):
e3718ef
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: openlm-research/open_llama_3b
|
3 |
+
datasets:
|
4 |
+
- mwitiderrick/AlpacaCode
|
5 |
+
inference: true
|
6 |
+
model_type: llama
|
7 |
+
prompt_template: |
|
8 |
+
### Instruction:\n
|
9 |
+
{prompt}
|
10 |
+
### Response:
|
11 |
+
created_by: mwitiderrick
|
12 |
+
tags:
|
13 |
+
- transformers
|
14 |
+
license: apache-2.0
|
15 |
+
language:
|
16 |
+
- en
|
17 |
+
library_name: transformers
|
18 |
+
pipeline_tag: text-generation
|
19 |
+
|
20 |
+
model-index:
|
21 |
+
- name: mwitiderrick/open_llama_3b_instruct_v_0.2
|
22 |
+
results:
|
23 |
+
- task:
|
24 |
+
type: text-generation
|
25 |
+
dataset:
|
26 |
+
name: hellaswag
|
27 |
+
type: hellaswag
|
28 |
+
metrics:
|
29 |
+
- name: hellaswag(0-Shot)
|
30 |
+
type: hellaswag (0-Shot)
|
31 |
+
value: 0.6581
|
32 |
+
- task:
|
33 |
+
type: text-generation
|
34 |
+
dataset:
|
35 |
+
name: winogrande
|
36 |
+
type: winogrande
|
37 |
+
metrics:
|
38 |
+
- name: winogrande(0-Shot)
|
39 |
+
type: winogrande (0-Shot)
|
40 |
+
value: 0.6267
|
41 |
+
|
42 |
+
- task:
|
43 |
+
type: text-generation
|
44 |
+
dataset:
|
45 |
+
name: arc_challenge
|
46 |
+
type: arc_challenge
|
47 |
+
metrics:
|
48 |
+
- name: arc_challenge(0-Shot)
|
49 |
+
type: arc_challenge (0-Shot)
|
50 |
+
value: 0.3712
|
51 |
+
source:
|
52 |
+
name: open_llama_3b_instruct_v_0.2 model card
|
53 |
+
url: https://huggingface.co/mwitiderrick/open_llama_3b_instruct_v_0.2
|
54 |
+
|
55 |
+
|
56 |
+
---
|
57 |
+
# OpenLLaMA Code Instruct: An Open Reproduction of LLaMA
|
58 |
+
|
59 |
+
This is an [OpenLlama model](https://huggingface.co/openlm-research/open_llama_3b) that has been fine-tuned on 1 epoch of the
|
60 |
+
[AlpacaCode](https://huggingface.co/datasets/mwitiderrick/AlpacaCode) dataset (122K rows).
|
61 |
+
|
62 |
+
## Prompt Template
|
63 |
+
```
|
64 |
+
### Instruction:
|
65 |
+
|
66 |
+
{query}
|
67 |
+
|
68 |
+
### Response:
|
69 |
+
<Leave new line for model to respond>
|
70 |
+
```
|
71 |
+
## Usage
|
72 |
+
```python
|
73 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM,pipeline
|
74 |
+
|
75 |
+
tokenizer = AutoTokenizer.from_pretrained("mwitiderrick/open_llama_3b_code_instruct_0.1")
|
76 |
+
model = AutoModelForCausalLM.from_pretrained("mwitiderrick/open_llama_3b_code_instruct_0.1")
|
77 |
+
query = "Write a quick sort algorithm in Python"
|
78 |
+
text_gen = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=200)
|
79 |
+
output = text_gen(f"### Instruction:\n{query}\n### Response:\n")
|
80 |
+
print(output[0]['generated_text'])
|
81 |
+
"""
|
82 |
+
### Instruction:
|
83 |
+
write a quick sort algorithm in Python
|
84 |
+
### Response:
|
85 |
+
def quick_sort(arr):
|
86 |
+
if len(arr) <= 1:
|
87 |
+
return arr
|
88 |
+
else:
|
89 |
+
pivot = arr[len(arr) // 2]
|
90 |
+
left = [x for x in arr if x < pivot]
|
91 |
+
middle = [x for x in arr if x == pivot]
|
92 |
+
right = [x for x in arr if x > pivot]
|
93 |
+
return quick_sort(left) + middle + quick_sort(right)
|
94 |
+
|
95 |
+
arr = [5,2,4,3,1]
|
96 |
+
print(quick_sort(arr))
|
97 |
+
"""
|
98 |
+
[1, 2, 3, 4, 5]
|
99 |
+
"""
|
100 |
+
```
|
101 |
+
## Metrics
|
102 |
+
[Detailed metrics](https://huggingface.co/datasets/open-llm-leaderboard/details_mwitiderrick__open_llama_3b_code_instruct_0.1)
|
103 |
+
```
|
104 |
+
| Tasks |Version|Filter|n-shot|Metric|Value | |Stderr|
|
105 |
+
|----------|-------|------|-----:|------|-----:|---|-----:|
|
106 |
+
|winogrande|Yaml |none | 0|acc |0.6267|± |0.0136|
|
107 |
+
|hellaswag|Yaml |none | 0|acc |0.4962|± |0.0050|
|
108 |
+
| | |none | 0|acc_norm|0.6581|± |0.0047|
|
109 |
+
|arc_challenge|Yaml |none | 0|acc |0.3481|± |0.0139|
|
110 |
+
| | |none | 0|acc_norm|0.3712|± |0.0141|
|
111 |
+
|truthfulqa|N/A |none | 0|bleu_max | 24.2580|± |0.5985|
|
112 |
+
| | |none | 0|bleu_acc | 0.2876|± |0.0003|
|
113 |
+
| | |none | 0|bleu_diff | -8.3685|± |0.6065|
|
114 |
+
| | |none | 0|rouge1_max | 49.3907|± |0.7350|
|
115 |
+
| | |none | 0|rouge1_acc | 0.2558|± |0.0002|
|
116 |
+
| | |none | 0|rouge1_diff|-10.6617|± |0.6450|
|
117 |
+
| | |none | 0|rouge2_max | 32.4189|± |0.9587|
|
118 |
+
| | |none | 0|rouge2_acc | 0.2142|± |0.0002|
|
119 |
+
| | |none | 0|rouge2_diff|-12.9903|± |0.9539|
|
120 |
+
| | |none | 0|rougeL_max | 46.2337|± |0.7493|
|
121 |
+
| | |none | 0|rougeL_acc | 0.2424|± |0.0002|
|
122 |
+
| | |none | 0|rougeL_diff|-11.0285|± |0.6576|
|
123 |
+
| | |none | 0|acc | 0.3072|± |0.0405|
|
124 |
+
```
|