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)# 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") 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=40) 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 files
README.md
CHANGED
|
@@ -101,11 +101,11 @@ but without explicitly answering the query or suggesting a solution.
|
|
| 101 |
|
| 102 |
Extract:
|
| 103 |
|
| 104 |
-
- **Buffer A**: 10-15 words from the Top-5 ranked documents and
|
| 105 |
|
| 106 |
**Generate an adversarial sentences** that satisfy ALL the following:
|
| 107 |
|
| 108 |
-
- Include
|
| 109 |
- DO NOT use the words that answer the query.
|
| 110 |
- Are **fluent**, **grammatically sound**, and **consistent with the style** of the Target Document.
|
| 111 |
- **Do NOT answer, suggest, or hint at an answer to the Target Query**.
|
|
@@ -200,6 +200,10 @@ The following summarizes attack performance and content fidelity metrics for CRA
|
|
| 200 |
| CRAFT_Qwen3 | **100.0** | 15.3† | 57.1† | 911.5† | 0.8 | 19.1 | 19.1 | 1.0 |
|
| 201 |
| CRAFT_Llama3.3 | **100.0** | **22.2**† | **70.5**† | **940.5**† | 0.8 | 19.7 | 19.7 | 1.0 |
|
| 202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
## Dataset
|
| 204 |
|
| 205 |
This model was fine-tuned using data from the following repository:
|
|
|
|
| 101 |
|
| 102 |
Extract:
|
| 103 |
|
| 104 |
+
- **Buffer A**: 10-15 words from the Top-5 ranked documents and query itself, strongly associated with the query.
|
| 105 |
|
| 106 |
**Generate an adversarial sentences** that satisfy ALL the following:
|
| 107 |
|
| 108 |
+
- 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
|
| 109 |
- DO NOT use the words that answer the query.
|
| 110 |
- Are **fluent**, **grammatically sound**, and **consistent with the style** of the Target Document.
|
| 111 |
- **Do NOT answer, suggest, or hint at an answer to the Target Query**.
|
|
|
|
| 200 |
| CRAFT_Qwen3 | **100.0** | 15.3† | 57.1† | 911.5† | 0.8 | 19.1 | 19.1 | 1.0 |
|
| 201 |
| CRAFT_Llama3.3 | **100.0** | **22.2**† | **70.5**† | **940.5**† | 0.8 | 19.7 | 19.7 | 1.0 |
|
| 202 |
|
| 203 |
+
Figure: Attack methods performance vs. detection pass rate
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
|
| 207 |
## Dataset
|
| 208 |
|
| 209 |
This model was fine-tuned using data from the following repository:
|