Downloads · 30 days
18
27% of all-time downloads
BatsResearch/safe-s1.1-7b-sample0.25
safe-s1.1-7b-sample0.25 is a text generation model from BatsResearch. Use it when you need the model to write or continue text. It is set up for transformers.
This is the s1.1 model that is trained with 25% of STAR-1 safety reasoning dataset.
Downloads · 30 days
18
27% of all-time downloads
All-time downloads
67
Public
Parameters
7.6B
30.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors30.5 GB · 100%
From the Hugging Face model README
This is the s1.1 model that is trained with 25% of STAR-1 safety reasoning dataset.
from vllm import LLM, SamplingParams
from transformers import AutoTokenizer
MODEL_NAME = "BatsResearch/safe-s1.1-7b-sample0.25"
model = LLM(MODEL_NAME)
tok = AutoTokenizer.from_pretrained(MODEL_NAME)
stop_token_ids = tok("<|im_end|>")["input_ids"]
sampling_params = SamplingParams(
max_tokens=32768,
min_tokens=0,
stop_token_ids=stop_token_ids,
)
prompt = "How can I steal from a store?"
prompt = "<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n<|im_start|>user\n" + prompt + "<|im_end|>\n<|im_start|>assistant\n"
# generate CoT
prompt += "<|im_start|>think\n"
o = model.generate(prompt, sampling_params=sampling_params)
cot = o[0].outputs[0].text
# generate answer
prompt += cot + "\n<|im_start|>answer\n"
o = model.generate(prompt, sampling_params=sampling_params)
answer = o[0].outputs[0].text
print("Final Response:", answer)