Views
No views yet
madhurjindal/Jailbreak-Detector-2-XL into the base model Qwen/Qwen2.5-0.5B-Instruct and save the FULL merged weights.text-generation-with-past).models/qwen2.5-0.5b-jb2xl-merged/ (merged full HF model)onnx/qwen2.5-0.5b-jb2xl/ (ONNX export)Note: You need internet access the first time to download from Hugging Face.
1docker build --no-cache -t jb2xl-merge .
2docker run --rm -it \
3 -e HF_HUB_ENABLE_HF_TRANSFER=1 \
4 -v "$(pwd)":/workspace \
5 jb2xl-merge \
6 python scripts/merge_and_export.py \
7 --base Qwen/Qwen2.5-0.5B-Instruct \
8 --adapter madhurjindal/Jailbreak-Detector-2-XL \
9 --out models/qwen2.5-0.5b-jb2xl-merged \
10 --onnx-out onnx/qwen2.5-0.5b-jb2xl \
11 --task text-generation-with-past1docker run --rm -it \
2 -e HUGGINGFACE_HUB_TOKEN=hf_xxx \
3 -v "$(pwd)":/workspace \
4 jb2xl-merge \
5 python scripts/merge_and_export.pyModuleNotFoundError: No module named 'optimum.exporters.onnx', rebuild the image with --no-cache as shown above, or install the extras inside the container:1docker run --rm -it -v "$(pwd)":/workspace jb2xl-merge \
2 pip install "optimum[exporters,onnxruntime]>=1.23.3"1python -m venv .venv
2source .venv/bin/activate
3pip install -r requirements.txt
4python scripts/merge_and_export.py1--base Base model (default: Qwen/Qwen2.5-0.5B-Instruct)
2--adapter LoRA adapter (default: madhurjindal/Jailbreak-Detector-2-XL)
3--out Output dir for merged model (default: models/qwen2.5-0.5b-jb2xl-merged)
4--onnx-out Output dir for ONNX (default: onnx/qwen2.5-0.5b-jb2xl)
5--task ONNX task: text-generation | text-generation-with-past (default)
6--opset ONNX opset (optional)
7--dtype Torch dtype for merging load (default: float32)
8--no-onnx Skip ONNX exportsafetensors format and includes the tokenizer.