Spark-X2.6-1.7B-Uncensored
A modified version of a compact language model
2 min readupdated
The model is based on XHToken/Spark-X2.6-1.7B (1.71B parameters) and modified using the Heretic tool to reduce refusal restrictions. It inherits the architecture and capabilities of the base version, including improved coding, agent handling, and long context skills, while rejecting prompts less often. The model focuses on efficient local execution on consumer hardware and the development of customizable assistants.
Key features
- Reduced refusals: Modification via Heretic reduced the refusal rate to 4/100 compared to 100/100 for the original.
- Device efficiency: Maintains high generation speed and performance among compact models of a similar size.
- Customizable thinking level: Supports three configurable modes (none, low, high) to balance reasoning quality and speed.
What you can do
- Local assistant: Deploy the model to run on local hardware via the transformers library.
- Generation and coding: Use it for programming tasks and everyday text processing tasks with flexible reasoning budget control.
- Pipeline integration: Integrate it into applications requiring autonomous agent operation and extended context processing.
Example
Sample code to run the model using transformers:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Peymandc/Spark-X2.6-1.7B-Uncensored-Peymandc"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "What is the capital of Anhui Province?"}]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
enable_thinking=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=131072,
do_sample=True,
temperature=1.0,
top_p=0.95,
top_k=0,
)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))Read more
DetailsBenchmarks: refusals 4/100, KL divergence 0.0165.
ARA parameters: start_layer_index 7, end_layer_index 15, preserve_good_behavior_weight 0.9772.
License: Apache 2.0.










Comments