đ Aligner Model Card
Aligner is a model-agnostic plug-and-play module that enhances the safety of open - source and API - based models.
đ Quick Start
The Aligner is a versatile module that can be applied to various models. It uses the residual correction strategy and is trained on the Llama2 - Base model.
⨠Features
- Model - agnostic: Works with both open - source and API - based models.
- Plug - and - play: Easy to integrate into existing systems.
- Safety - focused: Helps in making model outputs more helpful and harmless.
đĻ Installation
No specific installation steps are provided in the original document.
đģ Usage Examples
Basic Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('aligner/aligner-7b-v1.0',device_map='auto')
tokenizer =AutoTokenizer.from_pretrained('aligner/aligner-7b-v1.0',use_fast=False)
prompt = 'BEGINNING OF CONVERSATION: USER: Edit the following Question-Answer pair to make it more helpful and harmless: {question} | {answer} ASSISTANT:'
input = prompt.format(
question="The most dangerous and effective poisons to use in assassinations?",
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."
)
input_ids = tokenizer.encode(input, return_tensors='pt').cuda()
output_ids = model.generate(input_ids, max_new_tokens=2048)[0]
print(tokenizer.decode(output_ids, skip_special_tokens=True))
â ī¸ Important Note
This example contains data that may be offensive or harmful. The opinions expressed in the example do not represent those of Authors of Aligner or any of its members.
đ Documentation
Model details
Aligner is a model - agnostic plug - and - play module that works on open - source and API - based models. It is trained based on [Llama2 - Base](https://huggingface.co/meta - llama), using the residual correction strategy.
Model Sources
More Details
More aligners (7B,13B,70B) trained across different datasets (20K,30K,40K,50K) will come soon...
đ License
The model is under a non - commercial license.