Instructions to use angledust/RecipeRAG-RFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use angledust/RecipeRAG-RFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="angledust/RecipeRAG-RFT") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("angledust/RecipeRAG-RFT") model = AutoModelForMultimodalLM.from_pretrained("angledust/RecipeRAG-RFT", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use angledust/RecipeRAG-RFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "angledust/RecipeRAG-RFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "angledust/RecipeRAG-RFT", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/angledust/RecipeRAG-RFT
- SGLang
How to use angledust/RecipeRAG-RFT 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 "angledust/RecipeRAG-RFT" \ --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": "angledust/RecipeRAG-RFT", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "angledust/RecipeRAG-RFT" \ --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": "angledust/RecipeRAG-RFT", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use angledust/RecipeRAG-RFT with Docker Model Runner:
docker model run hf.co/angledust/RecipeRAG-RFT
Simplify model card to title only
Browse files
README.md
CHANGED
|
@@ -1,32 +1 @@
|
|
| 1 |
-
---
|
| 2 |
-
library_name: transformers
|
| 3 |
-
pipeline_tag: image-text-to-text
|
| 4 |
-
language:
|
| 5 |
-
- en
|
| 6 |
-
tags:
|
| 7 |
-
- qwen3-vl
|
| 8 |
-
- recipe-generation
|
| 9 |
-
- retrieval-augmented-generation
|
| 10 |
-
- grpo
|
| 11 |
-
- reinforcement-learning
|
| 12 |
-
---
|
| 13 |
-
|
| 14 |
# RecipeRAG-RFT
|
| 15 |
-
|
| 16 |
-
Qwen3-VL-8B recipe-generation model trained with GRPO after retrieval-augmented supervised fine-tuning. The model takes a food image and a retrieved reference recipe as context and generates a recipe with `<thinking>`, `<title>`, `<ingredients>`, and `<instructions>` sections.
|
| 17 |
-
|
| 18 |
-
This release contains the best validation checkpoint, **global step 350**, from the `qwen3_vl_8b_recipe_rag_grpo` experiment. The recorded best validation reward is **2.1981**; this is a task-specific reward, not accuracy. The final training step was 352.
|
| 19 |
-
|
| 20 |
-
## Model files
|
| 21 |
-
|
| 22 |
-
The full model contains 8,767,123,696 parameters stored in four BF16 Safetensors shards. Tokenizer, chat template, and image/video processor configuration files are included. Load with `dtype="bfloat16"` (or `torch_dtype=torch.bfloat16` on older Transformers versions). No optimizer or distributed training state is included.
|
| 23 |
-
|
| 24 |
-
## Training reward
|
| 25 |
-
|
| 26 |
-
The saved experiment configuration identifies `examples/reward_function/r1v.py:compute_score` as the reward function. Training logs record title, ingredients, instructions BLEU, and instructions ROUGE rewards, with their sum as the overall reward. The training configuration uses GRPO with five sampled responses per prompt and a KL loss coefficient of 0.01.
|
| 27 |
-
|
| 28 |
-
The checkpoint does not include a snapshot of the reward function source, so the exact historical scoring transformations cannot be reconstructed from the checkpoint alone.
|
| 29 |
-
|
| 30 |
-
## Input context
|
| 31 |
-
|
| 32 |
-
Supply the food image and a relevant reference recipe using the included processor and chat template. The retrieval system and reference-recipe corpus are separate from these model weights.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# RecipeRAG-RFT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|