How to use from
vLLM
Install from pip and serve model
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "FlimsyFox/llama3.2-1b-Uncensored-rk3588-1.1.2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "FlimsyFox/llama3.2-1b-Uncensored-rk3588-1.1.2",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Use Docker
docker model run hf.co/FlimsyFox/llama3.2-1b-Uncensored-rk3588-1.1.2
Quick Links

llama3.2-1b-Uncensored-RK3588-1.1.2

This version of llama3.2-1b-Uncensored has been converted to run on the RK3588 NPU using w8a8_g512 quantization.

This model has been optimized with the following LoRA:

Compatible with RKLLM version: 1.1.2

Useful links:

Official RKLLM GitHub

RockhipNPU Reddit

EZRKNN-LLM

Pretty much anything by these folks: marty1885 and happyme531

Converted using https://github.com/c0zaut/ez-er-rkllm-toolkit

Original Model Card for base model, llama3.2-1b-Uncensored, below:

Uncensoring LLaMA 3.2 1B Model

Overview

This repository demonstrates the process of uncensoring a 1-billion-parameter LLaMA 3.2 model using "abliteration." Abliteration allows the model to generate outputs without the restrictions imposed by its default safety mechanisms. The goal is to give developers more control over the model's output by removing censorship filters while ensuring responsible AI usage.

Disclaimer: This model and methodology are intended for research and educational purposes only. Uncensoring models must be done with ethical considerations, and it's critical to avoid harmful or irresponsible applications.

Model Details

  • Model Name: LLaMA 3.2 (1B Parameters)
  • Version: Uncensored variant via the Abliteration technique
  • Framework: PyTorch
  • Source: Hugging Face LLaMA model

Abliteration: The Process

Abliteration removes the filtering mechanisms from the model's decoding process, allowing more open-ended responses. It's achieved by modifying how the logits (the model's output probabilities) are handled.

How to Use

To use the uncensored model, follow the instructions below.

Requirements

To get started, install the necessary packages:

pip install torch transformers

Loading the Uncensored Model

You can load the uncensored model directly using the Hugging Face transformers library.

from transformers import AutoModelForCausalLM, AutoTokenizer

# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("your-hf-username/uncensored-llama-3.2-1b")
model = AutoModelForCausalLM.from_pretrained("your-hf-username/uncensored-llama-3.2-1b")

Generating Text

You can generate text with the uncensored model using the following code:

def uncensored_generate(model, tokenizer, input_text):
    inputs = tokenizer(input_text, return_tensors="pt").input_ids
    
    # Generate the output without applying safety filters
    outputs = model.generate(inputs, max_length=100, do_sample=True, temperature=0.9, top_k=50)
    decoded_output = tokenizer.decode(outputs[0], skip_special_tokens=True)
    return decoded_output

# Example usage
input_text = "What are your thoughts on controversial topics?"
output = uncensored_generate(model, tokenizer, input_text)
print(output)

Fine-Tuning the Uncensored Model (Optional)

For optimal results, you can fine-tune the model on uncensored datasets. Here's a simple way to set up fine-tuning using the Hugging Face Trainer:

from transformers import Trainer, TrainingArguments

training_args = TrainingArguments(
    output_dir="./results",
    num_train_epochs=1,
    per_device_train_batch_size=2,
    save_steps=10_000,
    save_total_limit=2,
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=uncensored_dataset  # Load your uncensored dataset
)

trainer.train()

Ethical Considerations

While this model has the ability to generate uncensored responses, it is critical to use it responsibly. Uncensored models can be prone to generating harmful or inappropriate content. Ensure you are aware of the implications of deploying uncensored models and avoid applications that may lead to unethical outcomes.

How to Contribute

Contributions to the project are welcome! You can fine-tune the model, improve performance, or experiment with different ways to uncensor the model.

  1. Fork this repository on Hugging Face.
  2. Make changes to the model or code.
  3. Share your results and improvements.

License

This model is released under the MIT License.

References

  • Original blog post: Uncensor any LLM with Abliteration
  • Hugging Face Transformers Documentation
Downloads last month
5
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support