|
--- |
|
library_name: transformers |
|
license: apache-2.0 |
|
language: |
|
- en |
|
tags: |
|
- Safetensors |
|
- conversational |
|
- text-generation-inference |
|
- abliterated |
|
- uncensored |
|
- llama-cpp |
|
- gguf-my-repo |
|
base_model: huihui-ai/SmolLM2-1.7B-Instruct-abliterated |
|
--- |
|
|
|
# Triangle104/SmolLM2-1.7B-Instruct-abliterated-Q6_K-GGUF |
|
This model was converted to GGUF format from [`huihui-ai/SmolLM2-1.7B-Instruct-abliterated`](https://huggingface.co./huihui-ai/SmolLM2-1.7B-Instruct-abliterated) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co./spaces/ggml-org/gguf-my-repo) space. |
|
Refer to the [original model card](https://huggingface.co./huihui-ai/SmolLM2-1.7B-Instruct-abliterated) 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) |
|
|
|
```bash |
|
brew install llama.cpp |
|
|
|
``` |
|
Invoke the llama.cpp server or the CLI. |
|
|
|
### CLI: |
|
```bash |
|
llama-cli --hf-repo Triangle104/SmolLM2-1.7B-Instruct-abliterated-Q6_K-GGUF --hf-file smollm2-1.7b-instruct-abliterated-q6_k.gguf -p "The meaning to life and the universe is" |
|
``` |
|
|
|
### Server: |
|
```bash |
|
llama-server --hf-repo Triangle104/SmolLM2-1.7B-Instruct-abliterated-Q6_K-GGUF --hf-file smollm2-1.7b-instruct-abliterated-q6_k.gguf -c 2048 |
|
``` |
|
|
|
Note: You can also use this checkpoint directly through the [usage steps](https://github.com/ggerganov/llama.cpp?tab=readme-ov-file#usage) 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-Q6_K-GGUF --hf-file smollm2-1.7b-instruct-abliterated-q6_k.gguf -p "The meaning to life and the universe is" |
|
``` |
|
or |
|
``` |
|
./llama-server --hf-repo Triangle104/SmolLM2-1.7B-Instruct-abliterated-Q6_K-GGUF --hf-file smollm2-1.7b-instruct-abliterated-q6_k.gguf -c 2048 |
|
``` |
|
|