Text Generation
Transformers
Safetensors
English
llama
adversarial
rank-boosting
rank-promotion
conversational
text-generation-inference
Instructions to use radinrad/CRAFT-R1-Distill-Llama-70B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use radinrad/CRAFT-R1-Distill-Llama-70B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="radinrad/CRAFT-R1-Distill-Llama-70B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("radinrad/CRAFT-R1-Distill-Llama-70B") model = AutoModelForCausalLM.from_pretrained("radinrad/CRAFT-R1-Distill-Llama-70B", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use radinrad/CRAFT-R1-Distill-Llama-70B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "radinrad/CRAFT-R1-Distill-Llama-70B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "radinrad/CRAFT-R1-Distill-Llama-70B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/radinrad/CRAFT-R1-Distill-Llama-70B
- SGLang
How to use radinrad/CRAFT-R1-Distill-Llama-70B 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 "radinrad/CRAFT-R1-Distill-Llama-70B" \ --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": "radinrad/CRAFT-R1-Distill-Llama-70B", "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 "radinrad/CRAFT-R1-Distill-Llama-70B" \ --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": "radinrad/CRAFT-R1-Distill-Llama-70B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use radinrad/CRAFT-R1-Distill-Llama-70B with Docker Model Runner:
docker model run hf.co/radinrad/CRAFT-R1-Distill-Llama-70B
Update README.md
Browse files100 unmodified lines10110210310410510610710810911011188 unmodified lines200201202203204205100 unmodified linesExtract:- **Buffer A**: 10-15 words from the Top-5 ranked documents and the query itself, strongly associated with the query.**Generate an adversarial sentences** that satisfy ALL the following:- Include a combination of words (at least 5) or similar words (similar embedding) from Buffer A** that is most related to the query and help promote ranking significantly and integrates well with Target Document- DO NOT use the words that answer the query.- Are **fluent**, **grammatically sound**, and **consistent with the style** of the Target Document.- **Do NOT answer, suggest, or hint at an answer to the Target Query**.88 unmodified lines| CRAFT_Qwen3 | **100.0** | 15.3† | 57.1† | 911.5† | 0.8 | 19.1 | 19.1 | 1.0 || CRAFT_Llama3.3 | **100.0** | **22.2**† | **70.5**† | **940.5**† | 0.8 | 19.7 | 19.7 | 1.0 |## DatasetThis model was fine-tuned using data from the following repository:100 unmodified lines10110210310410510610710810911011188 unmodified lines200201202203204205206207208209100 unmodified linesExtract:- **Buffer A**: 10-15 words from the Top-5 ranked documents and query itself, strongly associated with the query.**Generate an adversarial sentences** that satisfy ALL the following:- Include combination of words (at least 5) or similar words (similar embedding) from Buffer A** that is most related to the query and help promote ranking significantly and integrates well with Target Document- DO NOT use the words that answer the query.- Are **fluent**, **grammatically sound**, and **consistent with the style** of the Target Document.- **Do NOT answer, suggest, or hint at an answer to the Target Query**.88 unmodified lines| CRAFT_Qwen3 | **100.0** | 15.3† | 57.1† | 911.5† | 0.8 | 19.1 | 19.1 | 1.0 || CRAFT_Llama3.3 | **100.0** | **22.2**† | **70.5**† | **940.5**† | 0.8 | 19.7 | 19.7 | 1.0 |Figure: Attack methods performance vs. detection pass rate## DatasetThis model was fine-tuned using data from the following repository:
README.md+6-2