Instructions to use mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated") model = AutoModelForCausalLM.from_pretrained("mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated
- SGLang
How to use mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated with Docker Model Runner:
docker model run hf.co/mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated
Can we get Meta-Llama-3.1-8B-Instruct-ablitrated GGUF?
I was wondering if you could make this in GGUF form? Thanks.
looks like he is making GGUFs right now. I am waiting as well.
Yes they're coming https://huggingface.co/mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated-GGUF/tree/main
thank you. downloaded it and using it in Oobabooga. Works like a charm. merci
thank you. downloaded it and using it in Oobabooga. Works like a charm. merci
are you sure? Oobabooga compared to simple llama.cpp that you run in cmd, gives very different results. I'm asking all my usual reasoning questions, and in oobabooga it fails a lot complared to llama.cpp. I know it's probably because of the settings like "instruction template", but i have no idea how to fix this in Ooba. In standard llama.cpp this model performs much better. Here are the setting:
llama-cli -m Meta-Llama-3.1-8B-Instruct-abliterated.q5_k.gguf -p "<|start_header_id|>system<|end_header_id|>\n\nYou are a helpful, smart, kind, and efficient AI assistant. You always fulfill the user's requests to the best of your ability.<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n" -c 500 -ngl 3 -c 4096 --conversation --multiline-input --color --temp 0.1
Dear Mlabbone,
Have Meta fixed the method abliterated in the new version of llama-3.1?
I have uploaded your model mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated\nand this model responds to many questions with "sorry, I cannot help you with this," while the model mlabonne/Meta-Llama-3-8B-Instruct-abliterated answers these questions as expected
@Workermen Can you send me the prompt you used? It worked in my tests
You didn't forget anything, the suggestion I linked was somebody trying to get it to work in a broken way. I only thought it worked because I'd been staring at my screen for too long. After taking a break and getting some sleep (which I should have done earlier :) and starting clean I have things working a lot better.