Image-Text-to-Text
Transformers
Safetensors
qwen2
text-generation
conversational
text-generation-inference
Instructions to use luzimu/WebGenAgent-LM-7B-Step-GRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use luzimu/WebGenAgent-LM-7B-Step-GRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="luzimu/WebGenAgent-LM-7B-Step-GRPO") 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)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("luzimu/WebGenAgent-LM-7B-Step-GRPO") model = AutoModelForCausalLM.from_pretrained("luzimu/WebGenAgent-LM-7B-Step-GRPO") 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 = 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
- vLLM
How to use luzimu/WebGenAgent-LM-7B-Step-GRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "luzimu/WebGenAgent-LM-7B-Step-GRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "luzimu/WebGenAgent-LM-7B-Step-GRPO", "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/luzimu/WebGenAgent-LM-7B-Step-GRPO
- SGLang
How to use luzimu/WebGenAgent-LM-7B-Step-GRPO 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 "luzimu/WebGenAgent-LM-7B-Step-GRPO" \ --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": "luzimu/WebGenAgent-LM-7B-Step-GRPO", "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 "luzimu/WebGenAgent-LM-7B-Step-GRPO" \ --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": "luzimu/WebGenAgent-LM-7B-Step-GRPO", "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 luzimu/WebGenAgent-LM-7B-Step-GRPO with Docker Model Runner:
docker model run hf.co/luzimu/WebGenAgent-LM-7B-Step-GRPO
Improve model card: Add pipeline tag, library, code link, and usage
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,16 +1,20 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
| 3 |
datasets:
|
| 4 |
- luzimu/webgen-agent_train_step-grpo
|
| 5 |
- luzimu/webgen-agent_train_sft
|
| 6 |
-
|
| 7 |
-
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
# WebGen-Agent
|
| 11 |
|
| 12 |
WebGen-Agent is an advanced website generation agent designed to autonomously create websites from natural language instructions. It was introduced in the paper [WebGen-Agent: Enhancing Interactive Website Generation with Multi-Level Feedback and Step-Level Reinforcement Learning](https://arxiv.org/pdf/2509.22644v1).
|
| 13 |
|
|
|
|
|
|
|
| 14 |
## Project Overview
|
| 15 |
|
| 16 |
WebGen-Agent combines state-of-the-art language models with specialized training techniques to create a powerful website generation tool. The agent can understand natural language instructions specifying appearance and functional requirements, iteratively generate website codebases, and refine them using visual and functional feedback.
|
|
@@ -55,6 +59,24 @@ These dual rewards provide dense, reliable process supervision that significantl
|
|
| 55 |
|
| 56 |

|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
## Citation
|
| 59 |
|
| 60 |
If you find our project useful, please cite:
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model:
|
| 3 |
+
- Qwen/Qwen2.5-Coder-7B-Instruct
|
| 4 |
datasets:
|
| 5 |
- luzimu/webgen-agent_train_step-grpo
|
| 6 |
- luzimu/webgen-agent_train_sft
|
| 7 |
+
license: mit
|
| 8 |
+
pipeline_tag: image-text-to-text
|
| 9 |
+
library_name: transformers
|
| 10 |
---
|
| 11 |
|
| 12 |
# WebGen-Agent
|
| 13 |
|
| 14 |
WebGen-Agent is an advanced website generation agent designed to autonomously create websites from natural language instructions. It was introduced in the paper [WebGen-Agent: Enhancing Interactive Website Generation with Multi-Level Feedback and Step-Level Reinforcement Learning](https://arxiv.org/pdf/2509.22644v1).
|
| 15 |
|
| 16 |
+
Code: https://github.com/mnluzimu/WebGen-Agent
|
| 17 |
+
|
| 18 |
## Project Overview
|
| 19 |
|
| 20 |
WebGen-Agent combines state-of-the-art language models with specialized training techniques to create a powerful website generation tool. The agent can understand natural language instructions specifying appearance and functional requirements, iteratively generate website codebases, and refine them using visual and functional feedback.
|
|
|
|
| 59 |
|
| 60 |

|
| 61 |
|
| 62 |
+
## Sample Usage
|
| 63 |
+
|
| 64 |
+
Before running inference, you should rename `.env.template` to `.env` and set the base urls and api keys for the agent-engine LLM and feedback VLM. They can be obtained from any openai-compatible providers such as [openrouter](https://openrouter.ai/), [modelscope](https://www.modelscope.cn/my/overview), [bailian](https://bailian.console.aliyun.com/#/home), and [llmprovider](https://llmprovider.ai/).
|
| 65 |
+
|
| 66 |
+
You can also deploy open-source VLMs and LLMs by running `src/scripts/deploy_qwenvl_32b.sh` and `src/scripts/deploy.sh`. Scripts for single inference and batch inference can be found at `src/scripts/infer_single.sh` and `src/scripts/infer_batch.sh`.
|
| 67 |
+
|
| 68 |
+
```bash
|
| 69 |
+
python src/infer_single.py \
|
| 70 |
+
--model deepseek-chat \
|
| 71 |
+
--vlm_model Qwen/Qwen2.5-VL-32B-Instruct \
|
| 72 |
+
--instruction "Please implement a wheel of fortune website." \
|
| 73 |
+
--workspace-dir workspaces_root/test \
|
| 74 |
+
--log-dir service_logs/test \
|
| 75 |
+
--max-iter 20 \
|
| 76 |
+
--overwrite \
|
| 77 |
+
--error-limit 5
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
## Citation
|
| 81 |
|
| 82 |
If you find our project useful, please cite:
|