Edit model card

Triangle104/SmolLM2-1.7B-Instruct-abliterated-Q4_K_S-GGUF

This model was converted to GGUF format from huihui-ai/SmolLM2-1.7B-Instruct-abliterated using llama.cpp via the ggml.ai's GGUF-my-repo space. Refer to the original model card for more details on the model.


Model details:

This is an uncensored version of HuggingFaceTB/SmolLM2-1.7B-Instruct created with abliteration (see remove-refusals-with-transformers to know more about it).

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

How to use

Transformers

pip install transformers

from transformers import AutoModelForCausalLM, AutoTokenizer checkpoint = "huihui-ai/SmolLM2-1.7B-Instruct-abliterated"

device = "cuda" # for GPU usage or "cpu" for CPU usage tokenizer = AutoTokenizer.from_pretrained(checkpoint)

for multiple GPUs install accelerate and do model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")

model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)

messages = [{"role": "user", "content": "What is the capital of France."}] input_text=tokenizer.apply_chat_template(messages, tokenize=False) inputs = tokenizer.encode(input_text, return_tensors="pt").to(device) outputs = model.generate(inputs, max_new_tokens=50, temperature=0.2, top_p=0.9, do_sample=True) print(tokenizer.decode(outputs[0]))


Use with llama.cpp

Install llama.cpp through brew (works on Mac and Linux)

brew install llama.cpp

Invoke the llama.cpp server or the CLI.

CLI:

llama-cli --hf-repo Triangle104/SmolLM2-1.7B-Instruct-abliterated-Q4_K_S-GGUF --hf-file smollm2-1.7b-instruct-abliterated-q4_k_s.gguf -p "The meaning to life and the universe is"

Server:

llama-server --hf-repo Triangle104/SmolLM2-1.7B-Instruct-abliterated-Q4_K_S-GGUF --hf-file smollm2-1.7b-instruct-abliterated-q4_k_s.gguf -c 2048

Note: You can also use this checkpoint directly through the usage steps listed in the Llama.cpp repo as well.

Step 1: Clone llama.cpp from GitHub.

git clone https://github.com/ggerganov/llama.cpp

Step 2: Move into the llama.cpp folder and build it with LLAMA_CURL=1 flag along with other hardware-specific flags (for ex: LLAMA_CUDA=1 for Nvidia GPUs on Linux).

cd llama.cpp && LLAMA_CURL=1 make

Step 3: Run inference through the main binary.

./llama-cli --hf-repo Triangle104/SmolLM2-1.7B-Instruct-abliterated-Q4_K_S-GGUF --hf-file smollm2-1.7b-instruct-abliterated-q4_k_s.gguf -p "The meaning to life and the universe is"

or

./llama-server --hf-repo Triangle104/SmolLM2-1.7B-Instruct-abliterated-Q4_K_S-GGUF --hf-file smollm2-1.7b-instruct-abliterated-q4_k_s.gguf -c 2048
Downloads last month
16
GGUF
Model size
1.71B params
Architecture
llama

4-bit

Inference API
Unable to determine this model’s pipeline type. Check the docs .

Model tree for Triangle104/SmolLM2-1.7B-Instruct-abliterated-Q4_K_S-GGUF