Text Generation
Transformers
Safetensors
English
qwen2
code-generation
conversational
text-generation-inference
Instructions to use luzimu/WebGen-LM-32B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use luzimu/WebGen-LM-32B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="luzimu/WebGen-LM-32B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("luzimu/WebGen-LM-32B") model = AutoModelForCausalLM.from_pretrained("luzimu/WebGen-LM-32B") 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
- vLLM
How to use luzimu/WebGen-LM-32B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "luzimu/WebGen-LM-32B" # 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/WebGen-LM-32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/luzimu/WebGen-LM-32B
- SGLang
How to use luzimu/WebGen-LM-32B 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/WebGen-LM-32B" \ --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/WebGen-LM-32B", "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 "luzimu/WebGen-LM-32B" \ --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/WebGen-LM-32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use luzimu/WebGen-LM-32B with Docker Model Runner:
docker model run hf.co/luzimu/WebGen-LM-32B
Improve model card: Add project page, tags, and sample usage
#2
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -5,17 +5,20 @@ datasets:
|
|
| 5 |
- luzimu/WebGen-Bench
|
| 6 |
language:
|
| 7 |
- en
|
|
|
|
| 8 |
license: mit
|
| 9 |
metrics:
|
| 10 |
- accuracy
|
| 11 |
-
library_name: transformers
|
| 12 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
# WebGen-LM
|
| 16 |
|
| 17 |
WebGen-LM is trained using the Bolt.diy trajectories generated from a subset of the training set of WebGen-Bench (🤗 [luzimu/WebGen-Bench](https://huggingface.co/datasets/luzimu/WebGen-Bench)). It has been introduced in the paper [WebGen-Bench: Evaluating LLMs on Generating Interactive and Functional Websites from Scratch](https://arxiv.org/abs/2505.03733).
|
| 18 |
|
|
|
|
| 19 |
The training data and code can be found at [WebGen-Bench (Github)](https://github.com/mnluzimu/WebGen-Bench).
|
| 20 |
|
| 21 |
The WebGen-LM family of models are as follows:
|
|
@@ -26,11 +29,52 @@ The WebGen-LM family of models are as follows:
|
|
| 26 |
|WebGen-LM-14B | 🤗 [luzimu/WebGen-LM-14B](https://huggingface.co/luzimu/WebGen-LM-14B) |
|
| 27 |
|WebGen-LM-32B | 🤗 [luzimu/WebGen-LM-32B](https://huggingface.co/luzimu/WebGen-LM-32B) |
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
## Performance on WebGen-Bench
|
| 30 |
|
| 31 |

|
| 32 |
|
| 33 |
-
|
| 34 |
## Citation
|
| 35 |
|
| 36 |
If you find our project useful, please cite:
|
|
@@ -44,4 +88,5 @@ If you find our project useful, please cite:
|
|
| 44 |
archivePrefix={arXiv},
|
| 45 |
primaryClass={cs.CL},
|
| 46 |
url={https://arxiv.org/abs/2505.03733},
|
| 47 |
-
}
|
|
|
|
|
|
| 5 |
- luzimu/WebGen-Bench
|
| 6 |
language:
|
| 7 |
- en
|
| 8 |
+
library_name: transformers
|
| 9 |
license: mit
|
| 10 |
metrics:
|
| 11 |
- accuracy
|
|
|
|
| 12 |
pipeline_tag: text-generation
|
| 13 |
+
tags:
|
| 14 |
+
- code-generation
|
| 15 |
---
|
| 16 |
|
| 17 |
# WebGen-LM
|
| 18 |
|
| 19 |
WebGen-LM is trained using the Bolt.diy trajectories generated from a subset of the training set of WebGen-Bench (🤗 [luzimu/WebGen-Bench](https://huggingface.co/datasets/luzimu/WebGen-Bench)). It has been introduced in the paper [WebGen-Bench: Evaluating LLMs on Generating Interactive and Functional Websites from Scratch](https://arxiv.org/abs/2505.03733).
|
| 20 |
|
| 21 |
+
Project page: https://webgen-bench.github.io/
|
| 22 |
The training data and code can be found at [WebGen-Bench (Github)](https://github.com/mnluzimu/WebGen-Bench).
|
| 23 |
|
| 24 |
The WebGen-LM family of models are as follows:
|
|
|
|
| 29 |
|WebGen-LM-14B | 🤗 [luzimu/WebGen-LM-14B](https://huggingface.co/luzimu/WebGen-LM-14B) |
|
| 30 |
|WebGen-LM-32B | 🤗 [luzimu/WebGen-LM-32B](https://huggingface.co/luzimu/WebGen-LM-32B) |
|
| 31 |
|
| 32 |
+
## Sample Usage
|
| 33 |
+
|
| 34 |
+
You can use this model with the `transformers` library for text generation tasks, specifically for code generation based on instructions.
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 38 |
+
import torch
|
| 39 |
+
|
| 40 |
+
model_id = "luzimu/WebGen-LM-32B"
|
| 41 |
+
|
| 42 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 43 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 44 |
+
model_id,
|
| 45 |
+
torch_dtype=torch.bfloat16,
|
| 46 |
+
device_map="auto"
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
messages = [
|
| 50 |
+
{"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."},
|
| 51 |
+
]
|
| 52 |
+
|
| 53 |
+
chat_input = tokenizer.apply_chat_template(
|
| 54 |
+
messages,
|
| 55 |
+
tokenize=False,
|
| 56 |
+
add_generation_prompt=True
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
+
model_inputs = tokenizer([chat_input], return_tensors="pt").to(model.device)
|
| 60 |
+
|
| 61 |
+
generated_ids = model.generate(
|
| 62 |
+
model_inputs.input_ids,
|
| 63 |
+
max_new_tokens=2048,
|
| 64 |
+
do_sample=True,
|
| 65 |
+
temperature=0.7,
|
| 66 |
+
top_p=0.95
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
# Decode only the newly generated tokens
|
| 70 |
+
output_text = tokenizer.decode(generated_ids[0][model_inputs.input_ids.shape[1]:], skip_special_tokens=False)
|
| 71 |
+
print(output_text)
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
## Performance on WebGen-Bench
|
| 75 |
|
| 76 |

|
| 77 |
|
|
|
|
| 78 |
## Citation
|
| 79 |
|
| 80 |
If you find our project useful, please cite:
|
|
|
|
| 88 |
archivePrefix={arXiv},
|
| 89 |
primaryClass={cs.CL},
|
| 90 |
url={https://arxiv.org/abs/2505.03733},
|
| 91 |
+
}
|
| 92 |
+
```
|