Text Generation
Transformers
Safetensors
Chinese
qwen3
rewrite4
rewrite4-medium
novel-rewrite
chinese
web-novel
jev
mtp
dflash
speculative-decoding
draft-model
text-generation-inference
Run this model with HF Jobs
Run beileng/rewrite4-medium-dflash2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/beileng/rewrite4-medium-dflash2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/beileng/rewrite4-medium-dflash2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/beileng/rewrite4-medium-dflash2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/beileng/rewrite4-medium-dflash2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use beileng/rewrite4-medium-dflash2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use beileng/rewrite4-medium-dflash2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="beileng/rewrite4-medium-dflash2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("beileng/rewrite4-medium-dflash2") model = AutoModel.from_pretrained("beileng/rewrite4-medium-dflash2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use beileng/rewrite4-medium-dflash2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "beileng/rewrite4-medium-dflash2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "beileng/rewrite4-medium-dflash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/beileng/rewrite4-medium-dflash2
- SGLang
How to use beileng/rewrite4-medium-dflash2 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 "beileng/rewrite4-medium-dflash2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "beileng/rewrite4-medium-dflash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "beileng/rewrite4-medium-dflash2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "beileng/rewrite4-medium-dflash2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use beileng/rewrite4-medium-dflash2 with Docker Model Runner:
docker model run hf.co/beileng/rewrite4-medium-dflash2
File size: 671 Bytes
7535544 | 1 2 3 | {"n_samples": 64, "bb_ce": 2.4338, "bb_kl": 2.4338, "sel_ce": 1.1484, "avg_top1": 0.3654, "avg_exp_acc": 0.3496, "per_pos_top1": [0.6602, 0.4829, 0.3843, 0.3174, 0.2695, 0.23, 0.2134], "per_pos_exp_acc": [0.705, 0.481, 0.3585, 0.2885, 0.2351, 0.2043, 0.175], "exp_accept_len": 2.211, "cot_top1": 0.0, "body_top1": 0.3654, "step": 0}
{"n_samples": 64, "bb_ce": 2.4129, "bb_kl": 2.4129, "sel_ce": 1.1475, "avg_top1": 0.3676, "avg_exp_acc": 0.3525, "per_pos_top1": [0.6606, 0.481, 0.3901, 0.3208, 0.272, 0.2314, 0.2173], "per_pos_exp_acc": [0.7071, 0.4848, 0.3633, 0.2924, 0.2371, 0.2069, 0.1759], "exp_accept_len": 2.222, "cot_top1": 0.0, "body_top1": 0.3676, "step": 200}
|