galileo-ai/ragbench
Viewer • Updated • 95.4k • 4.76k • 115
How to use Niraj-P-Chaudhari/securex-techqa-qwen3-8b-raft with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen3-8b-unsloth-bnb-4bit")
model = PeftModel.from_pretrained(base_model, "Niraj-P-Chaudhari/securex-techqa-qwen3-8b-raft")How to use Niraj-P-Chaudhari/securex-techqa-qwen3-8b-raft with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Niraj-P-Chaudhari/securex-techqa-qwen3-8b-raft to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Niraj-P-Chaudhari/securex-techqa-qwen3-8b-raft to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Niraj-P-Chaudhari/securex-techqa-qwen3-8b-raft to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="Niraj-P-Chaudhari/securex-techqa-qwen3-8b-raft",
max_seq_length=2048,
)QLoRA fine-tuned Qwen/Qwen3-8B using RAFT (arXiv:2403.10131)
for the SecureX AI enterprise Technical RAG pipeline.
from unsloth import FastLanguageModel
import torch
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "Niraj-P-Chaudhari/securex-techqa-qwen3-8b-raft",
max_seq_length = 2048,
dtype = None,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
msgs = [
{"role": "system", "content": "You are SecureX-HR..."},
{"role": "user", "content": "Question: ...\n\nRetrieved Documents:\n..."},
]
inputs = tokenizer.apply_chat_template(msgs, tokenize=True,
return_tensors="pt", enable_thinking=False).to("cuda")
out = model.generate(inputs, max_new_tokens=512, temperature=0.1)
print(tokenizer.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
@misc{zhang2024raft,
title={RAFT: Adapting Language Model to Domain Specific RAG},
author={Tianhao Zhang et al.},
year={2024},
eprint={2403.10131},
archivePrefix={arXiv}
}