Text Generation
Transformers
Safetensors
Chinese
qwen3_5
image-text-to-text
rewrite2
novel-rewrite
qwen3.5
4b
fp8
conversational
modelopt
Run this model with HF Jobs
Run beileng/rewrite2-4b-fp8 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/rewrite2-4b-fp8. 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/rewrite2-4b-fp8 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/rewrite2-4b-fp8. 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/rewrite2-4b-fp8. 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/rewrite2-4b-fp8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use beileng/rewrite2-4b-fp8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="beileng/rewrite2-4b-fp8") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("beileng/rewrite2-4b-fp8") model = AutoModelForMultimodalLM.from_pretrained("beileng/rewrite2-4b-fp8", device_map="auto") 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 = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use beileng/rewrite2-4b-fp8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "beileng/rewrite2-4b-fp8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "beileng/rewrite2-4b-fp8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/beileng/rewrite2-4b-fp8
- SGLang
How to use beileng/rewrite2-4b-fp8 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/rewrite2-4b-fp8" \ --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": "beileng/rewrite2-4b-fp8", "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 "beileng/rewrite2-4b-fp8" \ --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": "beileng/rewrite2-4b-fp8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use beileng/rewrite2-4b-fp8 with Docker Model Runner:
docker model run hf.co/beileng/rewrite2-4b-fp8
北棱 commited on
publish rewrite2 4b v125 fp8
Browse files12345678910111299a56ad067829913afe45df8c72a5f4cb1c86f1d641b00030e20946dae98fd9e INSTRUCTION_rewrite.txt65e8c436e96cb01c0b828eb3ca5672450f994546e59de0301590372a36f1d779 README.mdad940c3a681851dd0cb8923c33d15d239265b493176be8f169759b37d4f03490 chat_template.jinjad43cfc454382e1964d9d706111ea3e9d91d5dca4ceda6b699c92d79a3cd146f6 config.jsonf0a6f70fe8e23956ef9fd666b70d798c32ef1faa67f6617d67c146fb809b11c2 generation_config.jsoncde71149e17cef49688b337fc02be279f49169c5f7dd2b0b076b6977f837d74c hf_quant_config.json00659f2e55c3c08d76a1decdf370bac1cf20f2e8e94639cd725dcecc2013c248 model.safetensors27225450ac9c6529872ee1924fcb0962ff5634834f817040f444118116f4e516 preprocessor_config.json14932921ca485d458a04dafd8069fbb0a4505622a48208d19ed247115801385b processor_config.json06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523 tokenizer.json6336d9609ab5fa0f742dd36d33a338ab82b57b57076219ecf85c6bc906a6af99 tokenizer_config.json7768af27c1fafa9cc9011c1dc20067e03f8915e03b63504550e11d5066986d13 video_preprocessor_config.jsonSHA256SUMSAdded+12