You can use this model with the transformers library for text generation tasks, specifically for code generation based on instructions.
python
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
34model_id ="luzimu/WebGen-LM-32B"56tokenizer = AutoTokenizer.from_pretrained(model_id)7model = AutoModelForCausalLM.from_pretrained(8 model_id,9 torch_dtype=torch.bfloat16,10 device_map="auto"11)1213messages =[14{"role":"user","content":"Write HTML, CSS, and JavaScript for a simple to-do list web application. The list should allow users to add and remove items."},15]1617chat_input = tokenizer.apply_chat_template(18 messages,19 tokenize=False,20 add_generation_prompt=True21)2223model_inputs = tokenizer([chat_input], return_tensors="pt").to(model.device)2425generated_ids = model.generate(26 model_inputs.input_ids,27 max_new_tokens=2048,28 do_sample=True,29 temperature=0.7,30 top_p=0.9531)3233# Decode only the newly generated tokens34output_text = tokenizer.decode(generated_ids[0][model_inputs.input_ids.shape[1]:], skip_special_tokens=False)35print(output_text)
Performance on WebGen-Bench
image/png
Citation
If you find our project useful, please cite:
@misc{lu2025webgenbenchevaluatingllmsgenerating,
title={WebGen-Bench: Evaluating LLMs on Generating Interactive and Functional Websites from Scratch},
author={Zimu Lu and Yunqiao Yang and Houxing Ren and Haotian Hou and Han Xiao and Ke Wang and Weikang Shi and Aojun Zhou and Mingjie Zhan and Hongsheng Li},
year={2025},
eprint={2505.03733},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2505.03733},
}
@misc{lu2025webgenagentenhancinginteractivewebsite,
title={WebGen-Agent: Enhancing Interactive Website Generation with Multi-Level Feedback and Step-Level Reinforcement Learning},
author={Zimu Lu and Houxing Ren and Yunqiao Yang and Ke Wang and Zhuofan Zong and Junting Pan and Mingjie Zhan and Hongsheng Li},
year={2025},
eprint={2509.22644},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2509.22644},
}