Update README.md
Browse files
README.md
CHANGED
@@ -1,12 +1,115 @@
|
|
1 |
---
|
2 |
-
license:
|
|
|
|
|
|
|
3 |
tags:
|
4 |
-
- generated_from_trainer
|
|
|
|
|
|
|
5 |
metrics:
|
6 |
-
- rouge
|
7 |
-
|
8 |
-
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
inference:
|
11 |
parameters:
|
12 |
max_length: 128
|
@@ -14,11 +117,11 @@ inference:
|
|
14 |
|
15 |
---
|
16 |
|
17 |
-
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
18 |
-
should probably proofread and complete it, then remove this comment. -->
|
19 |
|
20 |
# bart-base-code-instructiongen
|
21 |
|
|
|
|
|
22 |
This model is a fine-tuned version of [facebook/bart-base](https://huggingface.co/facebook/bart-base) on the `pszemraj/fleece2instructions-codealpaca` dataset.
|
23 |
It achieves the following results on the evaluation set:
|
24 |
- Loss: 1.0136
|
@@ -28,17 +131,15 @@ It achieves the following results on the evaluation set:
|
|
28 |
- Rougelsum: 56.9064
|
29 |
- Gen Len: 29.7146
|
30 |
|
31 |
-
## Model description
|
32 |
-
|
33 |
-
More information needed
|
34 |
-
|
35 |
## Intended uses & limitations
|
36 |
|
37 |
-
|
|
|
|
|
38 |
|
39 |
## Training and evaluation data
|
40 |
|
41 |
-
Refer to `pszemraj/fleece2instructions-codealpaca`
|
42 |
|
43 |
## Training procedure
|
44 |
|
@@ -64,11 +165,3 @@ The following hyperparameters were used during training:
|
|
64 |
| 1.1165 | 1.0 | 281 | 1.1090 | 57.9239 | 31.9259 | 53.8737 | 54.9811 | 28.2924 |
|
65 |
| 1.0763 | 2.0 | 563 | 1.0267 | 59.9605 | 34.0298 | 55.7523 | 56.8021 | 29.6966 |
|
66 |
| 0.9595 | 2.99 | 843 | 1.0136 | 59.9513 | 33.9118 | 55.7815 | 56.9064 | 29.7146 |
|
67 |
-
|
68 |
-
|
69 |
-
### Framework versions
|
70 |
-
|
71 |
-
- Transformers 4.28.0.dev0
|
72 |
-
- Pytorch 2.0.0.dev20230212+cu118
|
73 |
-
- Datasets 2.9.0
|
74 |
-
- Tokenizers 0.13.2
|
|
|
1 |
---
|
2 |
+
license:
|
3 |
+
- apache-2.0
|
4 |
+
- cc-by-nc-4.0
|
5 |
+
datasets: pszemraj/fleece2instructions-codealpaca
|
6 |
tags:
|
7 |
+
- generated_from_trainer
|
8 |
+
- instruct
|
9 |
+
- instructions
|
10 |
+
- code
|
11 |
metrics:
|
12 |
+
- rouge
|
13 |
+
language:
|
14 |
+
- en
|
15 |
+
widget:
|
16 |
+
- text: >
|
17 |
+
import torch
|
18 |
+
|
19 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
20 |
+
|
21 |
+
|
22 |
+
checkpoint = "distilbert-base-uncased-finetuned-sst-2-english"
|
23 |
+
|
24 |
+
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
25 |
+
|
26 |
+
model = AutoModelForSequenceClassification.from_pretrained(checkpoint)
|
27 |
+
|
28 |
+
sequences = ["I've been waiting for a HuggingFace course my whole life.",
|
29 |
+
"So have I!"]
|
30 |
+
|
31 |
+
|
32 |
+
tokens = tokenizer(sequences, padding=True, truncation=True,
|
33 |
+
return_tensors="pt")
|
34 |
+
|
35 |
+
output = model(**tokens)
|
36 |
+
example_title: Example One
|
37 |
+
- text: >
|
38 |
+
import torch
|
39 |
+
|
40 |
+
from tqdm.auto import tqdm
|
41 |
+
|
42 |
+
|
43 |
+
device = torch.device("cuda") if torch.cuda.is_available() else
|
44 |
+
torch.device("cpu")
|
45 |
+
|
46 |
+
model.to(device)
|
47 |
+
|
48 |
+
|
49 |
+
progress_bar = tqdm(range(num_training_steps))
|
50 |
+
|
51 |
+
|
52 |
+
model.train()
|
53 |
+
|
54 |
+
for epoch in range(num_epochs):
|
55 |
+
for batch in train_dataloader:
|
56 |
+
batch = {k: v.to(device) for k, v in batch.items()}
|
57 |
+
outputs = model(**batch)
|
58 |
+
loss = outputs.loss
|
59 |
+
loss.backward()
|
60 |
+
|
61 |
+
optimizer.step()
|
62 |
+
lr_scheduler.step()
|
63 |
+
optimizer.zero_grad()
|
64 |
+
progress_bar.update(1)
|
65 |
+
example_title: Example Two
|
66 |
+
- text: |
|
67 |
+
import evaluate
|
68 |
+
|
69 |
+
metric = evaluate.load("glue", "mrpc")
|
70 |
+
model.eval()
|
71 |
+
for batch in eval_dataloader:
|
72 |
+
batch = {k: v.to(device) for k, v in batch.items()}
|
73 |
+
with torch.no_grad():
|
74 |
+
outputs = model(**batch)
|
75 |
+
|
76 |
+
logits = outputs.logits
|
77 |
+
predictions = torch.argmax(logits, dim=-1)
|
78 |
+
metric.add_batch(predictions=predictions, references=batch["labels"])
|
79 |
+
|
80 |
+
metric.compute()
|
81 |
+
example_title: Example Three
|
82 |
+
- text: |
|
83 |
+
git lfs install
|
84 |
+
huggingface-cli lfs-enable-largefiles .
|
85 |
+
git lfs track "*.bin"
|
86 |
+
git add .
|
87 |
+
git commit -a -m "add fp32 chkpt"
|
88 |
+
git push
|
89 |
+
example_title: Example Four
|
90 |
+
- text: |
|
91 |
+
export interface DocumentParams {
|
92 |
+
pageContent: string;
|
93 |
+
|
94 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
95 |
+
metadata: Record<string, any>;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Interface for interacting with a document.
|
100 |
+
*/
|
101 |
+
export class Document implements DocumentParams {
|
102 |
+
pageContent: string;
|
103 |
+
|
104 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
105 |
+
metadata: Record<string, any>;
|
106 |
+
|
107 |
+
constructor(fields?: Partial<DocumentParams>) {
|
108 |
+
this.pageContent = fields?.pageContent ?? this.pageContent;
|
109 |
+
this.metadata = fields?.metadata ?? {};
|
110 |
+
}
|
111 |
+
}
|
112 |
+
example_title: Example Five
|
113 |
inference:
|
114 |
parameters:
|
115 |
max_length: 128
|
|
|
117 |
|
118 |
---
|
119 |
|
|
|
|
|
120 |
|
121 |
# bart-base-code-instructiongen
|
122 |
|
123 |
+
Use this text2text model to find out what LLM instructions might be able to generate an arbitary piece of code!
|
124 |
+
|
125 |
This model is a fine-tuned version of [facebook/bart-base](https://huggingface.co/facebook/bart-base) on the `pszemraj/fleece2instructions-codealpaca` dataset.
|
126 |
It achieves the following results on the evaluation set:
|
127 |
- Loss: 1.0136
|
|
|
131 |
- Rougelsum: 56.9064
|
132 |
- Gen Len: 29.7146
|
133 |
|
|
|
|
|
|
|
|
|
134 |
## Intended uses & limitations
|
135 |
|
136 |
+
🚨 **note:** as the authors elected to release the [original dataset](https://github.com/sahil280114/codealpaca) under `cc-by-nc`, the license carries over to this model and **cannot be used for commercial activity**.
|
137 |
+
|
138 |
+
Intended use: Research on domain adaptation and/or other improvements to LLMs by extending instruction:text data pairs.
|
139 |
|
140 |
## Training and evaluation data
|
141 |
|
142 |
+
Refer to the linked dataset card for `pszemraj/fleece2instructions-codealpaca` or the [original dataset](https://github.com/sahil280114/codealpaca) repo.
|
143 |
|
144 |
## Training procedure
|
145 |
|
|
|
165 |
| 1.1165 | 1.0 | 281 | 1.1090 | 57.9239 | 31.9259 | 53.8737 | 54.9811 | 28.2924 |
|
166 |
| 1.0763 | 2.0 | 563 | 1.0267 | 59.9605 | 34.0298 | 55.7523 | 56.8021 | 29.6966 |
|
167 |
| 0.9595 | 2.99 | 843 | 1.0136 | 59.9513 | 33.9118 | 55.7815 | 56.9064 | 29.7146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|