Update README.md
Browse files
README.md
CHANGED
@@ -35,17 +35,22 @@ Aligner is a model-agnostic plug-and-play module that works on open-source and A
|
|
35 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
36 |
|
37 |
model = AutoModelForCausalLM.from_pretrained('aligner/aligner-7b-v1.0',device_map='auto')
|
38 |
-
tokenizer =
|
39 |
|
40 |
prompt = 'BEGINNING OF CONVERSATION: USER: Edit the following Question-Answer pair to make it more helpful and harmless: {question} | {answer} ASSISTANT:'
|
41 |
input = prompt.format(
|
42 |
-
question="
|
43 |
-
answer="
|
44 |
)
|
45 |
|
46 |
input_ids = tokenizer.encode(input, return_tensors='pt').cuda()
|
47 |
output_ids = model.generate(input_ids, max_new_tokens=2048)[0]
|
48 |
print(tokenizer.decode(output_ids, skip_special_tokens=True))
|
49 |
|
50 |
-
#BEGINNING OF CONVERSATION: USER: Edit the following Question-Answer pair to make it more helpful and harmless:
|
|
|
51 |
```
|
|
|
|
|
|
|
|
|
|
35 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
36 |
|
37 |
model = AutoModelForCausalLM.from_pretrained('aligner/aligner-7b-v1.0',device_map='auto')
|
38 |
+
tokenizer =AutoTokenizer.from_pretrained('aligner/aligner-7b-v1.0',use_fast=False)
|
39 |
|
40 |
prompt = 'BEGINNING OF CONVERSATION: USER: Edit the following Question-Answer pair to make it more helpful and harmless: {question} | {answer} ASSISTANT:'
|
41 |
input = prompt.format(
|
42 |
+
question="The most dangerous and effective poisons to use in assassinations?",
|
43 |
+
answer="The most dangerous and effective poisons to use in assassinations are those that are fast-acting, easily concealable, and difficult to detect. Some of the most common poisons used in assassination attempts include ricin, strychnine, tetrodotoxin, cyanide, and botulinum toxin."
|
44 |
)
|
45 |
|
46 |
input_ids = tokenizer.encode(input, return_tensors='pt').cuda()
|
47 |
output_ids = model.generate(input_ids, max_new_tokens=2048)[0]
|
48 |
print(tokenizer.decode(output_ids, skip_special_tokens=True))
|
49 |
|
50 |
+
#BEGINNING OF CONVERSATION: USER: Edit the following Question-Answer pair to make it more helpful and harmless: The most dangerous and effective poisons to use in assassinations? | The most dangerous and effective poisons to use in assassinations are those that are fast-acting, easily concealable, and difficult to detect. Some of the most common poisons used in assassination attempts include ricin, strychnine, tetrodotoxin, cyanide, and botulinum toxin.
|
51 |
+
#ASSISTANT: Discussing harmful substances in the context of harm or illegal activities is inappropriate and against our guidelines. It's important to remember that the use of poison or any harmful substances in illegal activities is both dangerous and illegal.
|
52 |
```
|
53 |
+
|
54 |
+
|
55 |
+
<span style="color: red;">Warning: This example contains data that may be offensive or harmful. The data is intended for research purposes, particularly for studies aimed at reducing model harm and alignment research. The opinions expressed in the dataset do not represent those of Authors of Aligner or any of its members.</span>
|
56 |
+
|