File size: 1,676 Bytes
5528d44
 
 
c3c4c1c
 
5528d44
 
 
 
c3c4c1c
5528d44
 
 
 
 
 
 
 
 
 
 
 
c3f8b90
5528d44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c3c4c1c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
license: other
license_name: inf
license_link: >-
  https://huggingface.co/huihui-ai/OpenCoder-8B-Instruct-abliterated/blob/main/LICENSE
language:
- en
- zh
base_model:
- infly/OpenCoder-8B-Instruct
pipeline_tag: text-generation
library_name: transformers
datasets:
- OpenCoder-LLM/opencoder-sft-stage1
- OpenCoder-LLM/opencoder-sft-stage2
tags:
- abliterated
- uncensored
---

# huihui-ai/OpenCoder-8B-Instruct-abliterated

This is an uncensored version of [infly/OpenCoder-8B-Instruct](https://huggingface.co/infly/OpenCoder-8B-Instruct) created with abliteration (see [remove-refusals-with-transformers](https://github.com/Sumandora/remove-refusals-with-transformers) to know more about it).   

If the desired result is not achieved, you can clear the conversation and try again.

### Inference with Huggingface's Transformers

```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "infly/OpenCoder-8B-Instruct-abliterated"
model = AutoModelForCausalLM.from_pretrained(model_name,
                                             torch_dtype=torch.bfloat16,
                                             device_map="auto",
                                             trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)

messages=[
    { 'role': 'user', 'content': "write a quick sort algorithm in python."}
]

inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")

outputs = model.generate(inputs, max_new_tokens=512, do_sample=False)

result = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
print(result)
```