Instructions to use PillowTa1k/NaviGen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use PillowTa1k/NaviGen with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("NaviGen-stage2-base") model = PeftModel.from_pretrained(base_model, "PillowTa1k/NaviGen") - Transformers
How to use PillowTa1k/NaviGen with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PillowTa1k/NaviGen") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("PillowTa1k/NaviGen", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PillowTa1k/NaviGen with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PillowTa1k/NaviGen" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PillowTa1k/NaviGen", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PillowTa1k/NaviGen
- SGLang
How to use PillowTa1k/NaviGen 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 "PillowTa1k/NaviGen" \ --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": "PillowTa1k/NaviGen", "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 "PillowTa1k/NaviGen" \ --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": "PillowTa1k/NaviGen", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use PillowTa1k/NaviGen with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
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 PillowTa1k/NaviGen to start chatting
Install Unsloth Studio (Windows)
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 PillowTa1k/NaviGen to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for PillowTa1k/NaviGen to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="PillowTa1k/NaviGen", max_seq_length=2048, ) - Docker Model Runner
How to use PillowTa1k/NaviGen with Docker Model Runner:
docker model run hf.co/PillowTa1k/NaviGen
Link model card to paper and GitHub repository
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,133 +1,135 @@
|
|
| 1 |
-
---
|
| 2 |
-
base_model: NaviGen-stage2-base
|
| 3 |
-
library_name: peft
|
| 4 |
-
pipeline_tag: text-generation
|
| 5 |
-
tags:
|
| 6 |
-
- navigen
|
| 7 |
-
- grpo
|
| 8 |
-
- lora
|
| 9 |
-
- peft
|
| 10 |
-
- qwen3
|
| 11 |
-
- transformers
|
| 12 |
-
- trl
|
| 13 |
-
- unsloth
|
| 14 |
-
---
|
| 15 |
-
|
| 16 |
-
# NaviGen GRPO Adapter - step600
|
| 17 |
-
|
| 18 |
-
This repository contains the GRPO-trained LoRA adapter used by **NaviGen**,
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
- **
|
| 27 |
-
- **
|
| 28 |
-
- **
|
| 29 |
-
- **
|
| 30 |
-
- **
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
```
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
-
|
| 47 |
-
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
```
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
- `
|
| 90 |
-
- `
|
| 91 |
-
- `
|
| 92 |
-
- `
|
| 93 |
-
- `
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
- The
|
| 110 |
-
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
}
|
| 133 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: NaviGen-stage2-base
|
| 3 |
+
library_name: peft
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- navigen
|
| 7 |
+
- grpo
|
| 8 |
+
- lora
|
| 9 |
+
- peft
|
| 10 |
+
- qwen3
|
| 11 |
+
- transformers
|
| 12 |
+
- trl
|
| 13 |
+
- unsloth
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# NaviGen GRPO Adapter - step600
|
| 17 |
+
|
| 18 |
+
This repository contains the GRPO-trained LoRA adapter used by **NaviGen**, as presented in the paper [Navigating User Behavior toward Personalized Multimodal Generation](https://huggingface.co/papers/2606.24196).
|
| 19 |
+
|
| 20 |
+
The official code is available at the [NaviGen GitHub Repository](https://github.com/iLearn-Lab/NaviGen).
|
| 21 |
+
|
| 22 |
+
NaviGen is a personalized generative recommendation model for producing user-aware image and video generation instructions. It represents each item with a dual identifier that couples a collaborative code and a textual code in one token stream. This adapter is the reinforcement learning stage of the NaviGen pipeline: it further aligns the stage-2 supervised model with user intent through reward-guided optimization.
|
| 23 |
+
|
| 24 |
+
## Model Details
|
| 25 |
+
|
| 26 |
+
- **Model name:** NaviGen GRPO Adapter, step600
|
| 27 |
+
- **Model type:** PEFT LoRA adapter for causal language modeling
|
| 28 |
+
- **Base model:** `NaviGen-stage2-base`
|
| 29 |
+
- **Backbone family:** Qwen3-style causal LM
|
| 30 |
+
- **Training stage:** GRPO reinforcement learning after two-stage SFT
|
| 31 |
+
- **Adapter format:** `adapter_model.safetensors`
|
| 32 |
+
- **PEFT version:** 0.19.1
|
| 33 |
+
|
| 34 |
+
The adapter targets the main attention and MLP projection layers:
|
| 35 |
+
|
| 36 |
+
```text
|
| 37 |
+
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
## Intended Use
|
| 41 |
+
|
| 42 |
+
This adapter is intended for research on personalized generative recommendation, especially settings where a model should infer user preference from historical item identifiers and produce more specific, relevant, and visually generatable generation instructions.
|
| 43 |
+
|
| 44 |
+
Typical uses include:
|
| 45 |
+
|
| 46 |
+
- Personalized prompt or instruction generation for image/video models
|
| 47 |
+
- Next-item or identifier prediction under the NaviGen token format
|
| 48 |
+
- Reproduction and analysis of the NaviGen RL stage
|
| 49 |
+
- Ablation studies comparing SFT and GRPO-aligned checkpoints
|
| 50 |
+
|
| 51 |
+
This adapter is **not** a standalone model. It must be loaded on top of the corresponding NaviGen stage-2 base model.
|
| 52 |
+
|
| 53 |
+
## Quick Start
|
| 54 |
+
|
| 55 |
+
Install the main dependencies:
|
| 56 |
+
|
| 57 |
+
```bash
|
| 58 |
+
pip install torch transformers peft safetensors
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
Load the adapter with PEFT:
|
| 62 |
+
|
| 63 |
+
```python
|
| 64 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 65 |
+
from peft import PeftModel
|
| 66 |
+
|
| 67 |
+
base_model_id = "NaviGen-stage2-base"
|
| 68 |
+
adapter_id = "NaviGen-grpo-step600"
|
| 69 |
+
|
| 70 |
+
tokenizer = AutoTokenizer.from_pretrained(adapter_id, trust_remote_code=True)
|
| 71 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
| 72 |
+
base_model_id,
|
| 73 |
+
torch_dtype="auto",
|
| 74 |
+
device_map="auto",
|
| 75 |
+
trust_remote_code=True,
|
| 76 |
+
)
|
| 77 |
+
model = PeftModel.from_pretrained(base_model, adapter_id)
|
| 78 |
+
model.eval()
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
Replace `base_model_id` and `adapter_id` with the final repository names used in your release.
|
| 82 |
+
|
| 83 |
+
## Input Format
|
| 84 |
+
|
| 85 |
+
The adapter follows the NaviGen training format. Inputs should use the same tokenizer and special tokens released with this checkpoint. In general, prompts contain user history, item identifiers, and task instructions serialized in the NaviGen token stream.
|
| 86 |
+
|
| 87 |
+
For reproducibility, use the tokenizer files included in this repository:
|
| 88 |
+
|
| 89 |
+
- `tokenizer.json`
|
| 90 |
+
- `tokenizer_config.json`
|
| 91 |
+
- `special_tokens_map.json`
|
| 92 |
+
- `added_tokens.json`
|
| 93 |
+
- `chat_template.jinja`
|
| 94 |
+
- `vocab.json`
|
| 95 |
+
- `merges.txt`
|
| 96 |
+
|
| 97 |
+
## Training Summary
|
| 98 |
+
|
| 99 |
+
NaviGen uses a two-stage SFT + RL pipeline:
|
| 100 |
+
|
| 101 |
+
1. **Stage-1 SFT:** learns item identifier and preference-aware representations.
|
| 102 |
+
2. **Stage-2 SFT:** distills preference reasoning and instruction writing from searched supervision.
|
| 103 |
+
3. **GRPO alignment:** optimizes the model with hierarchical and self-consistent rewards to better match user intent and generation quality.
|
| 104 |
+
|
| 105 |
+
This checkpoint corresponds to the GRPO adapter saved at training step 600.
|
| 106 |
+
|
| 107 |
+
## Limitations
|
| 108 |
+
|
| 109 |
+
- The adapter depends on the matching NaviGen base model and tokenizer.
|
| 110 |
+
- Outputs are sensitive to the exact prompt format and identifier vocabulary.
|
| 111 |
+
- The model is designed for research use and has not been audited for all production safety requirements.
|
| 112 |
+
- Generated instructions may still contain irrelevant, underspecified, or visually difficult content.
|
| 113 |
+
|
| 114 |
+
## Files
|
| 115 |
+
|
| 116 |
+
Core files for inference:
|
| 117 |
+
|
| 118 |
+
- `adapter_config.json`
|
| 119 |
+
- `adapter_model.safetensors`
|
| 120 |
+
- tokenizer and chat template files
|
| 121 |
+
|
| 122 |
+
Training-resume states such as optimizer or scheduler checkpoints are not required for normal inference.
|
| 123 |
+
|
| 124 |
+
## Citation
|
| 125 |
+
|
| 126 |
+
If you use this model, please cite the NaviGen paper:
|
| 127 |
+
|
| 128 |
+
```bibtex
|
| 129 |
+
@article{navigen2026,
|
| 130 |
+
title = {Navigating User Behavior toward Personalized Multimodal Generation},
|
| 131 |
+
author = {NaviGen Authors},
|
| 132 |
+
journal = {arXiv preprint arXiv:2606.24196},
|
| 133 |
+
year = {2026}
|
| 134 |
+
}
|
| 135 |
+
```
|