Commit
·
deb8680
1
Parent(s):
ee39bd9
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,36 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- Anthropic/hh-rlhf
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
pipeline_tag: text-generation
|
8 |
---
|
9 |
+
|
10 |
+
|
11 |
+
# GPT-2 Medium Fine-Tuned on Anthropic-hh Dataset
|
12 |
+
|
13 |
+
This repository houses a GPT-2 Medium model fine-tuned on the Anthropic-hh dataset. The fine-tuning process involved masking Human's utterances, with the loss computed exclusively on the Assistant's responses.
|
14 |
+
|
15 |
+
## Model Information
|
16 |
+
|
17 |
+
- **Base Model:** GPT-2 Medium
|
18 |
+
- **Training Data:** Anthropic-hh dataset
|
19 |
+
- **Fine-Tuning Approach:** Supervised fine-tuning with a focus on Assistant's responses.
|
20 |
+
|
21 |
+
## How to Use
|
22 |
+
|
23 |
+
```python
|
24 |
+
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
25 |
+
|
26 |
+
# Load tokenizer and model
|
27 |
+
tokenizer = GPT2Tokenizer.from_pretrained("RaushanTurganbay/GPT2_instruct_tuned")
|
28 |
+
model = GPT2LMHeadModel.from_pretrained("RaushanTurganbay/GPT2_instruct_tuned")
|
29 |
+
|
30 |
+
# Generate responses
|
31 |
+
prompt = "Your input prompt here"
|
32 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
33 |
+
outputs = model.generate(**inputs, max_length=150, num_return_sequences=1)
|
34 |
+
|
35 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
36 |
+
```
|