Improve model card: Add metadata, paper link, code link, project blog link and usage instructions
#1
by nielsr HF Staff - opened
123Base Model: [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct)Training Data (Jacobi trajectories): https://huggingface.co/datasets/JacobiForcing/OpenCodeInstruct_training_data_n3212345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667---license: apache-2.0pipeline_tag: text-generationlibrary_name: transformers---# Jacobi Forcing: Fast and Accurate Causal Parallel DecodingThis repository contains the `JacobiForcing_Coder_7B_v1` model, presented in the paper [Fast and Accurate Causal Parallel Decoding using Jacobi Forcing](https://huggingface.co/papers/2512.14681).Base Model: [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct)Training Data (Jacobi trajectories): https://huggingface.co/datasets/JacobiForcing/OpenCodeInstruct_training_data_n32Jacobi Forcing is a novel training technique that converts Large Language Models (LLMs) into native causal parallel decoders. This approach maintains the causal autoregressive backbone and addresses the AR-to-diffusion mismatch by training the model to handle noisy future blocks along its own Jacobi decoding trajectories.It achieves up to $4.5\times$ higher tokens-per-forward and $4\times$ wall-clock speedup on coding and math tasks, while retaining near-AR generation quality.You can find more details on the project blog: [Jacobi Forcing Blog](https://hao-ai-lab.github.io/blogs/jacobi-forcing/)The official code repository is available here: [GitHub Repository](https://github.com/hao-ai-lab/JacobiForcing)## UsageYou can try the chatbot demo locally or use the provided Python inference code.### Local Chatbot Demo```bash# modify the script to use your local pathstreamlit run applications/jacobi_model_chat.py```### Inference with CodeYou can use our provided `eagenerate` function for speedup generation, similar to using `generate` from Hugging Face. Here is an example:```pythonfrom eagle.model.ea_model import EaModelfrom fastchat.model import get_conversation_templateimport torch# Assuming base_model_path and EAGLE_model_path are defined# For example:base_model_path = "Qwen/Qwen2.5-Coder-7B-Instruct"EAGLE_model_path = "JacobiForcing/JacobiForcing_Coder_7B_v1" # Or your local path to the weightsmodel = EaModel.from_pretrained(base_model_path=base_model_path,ea_model_path=EAGLE_model_path,torch_dtype=torch.float16,low_cpu_mem_usage=True,device_map="auto",total_token=-1 # Automatically configure draft tokens)model.eval()your_message="Hello"conv = get_conversation_template("vicuna") # Use appropriate conversation template for your base modelconv.append_message(conv.roles[0], your_message)conv.append_message(conv.roles[1], None)prompt = conv.get_prompt()input_ids = model.tokenizer([prompt]).input_idsinput_ids = torch.as_tensor(input_ids).cuda()output_ids = model.eagenerate(input_ids, temperature=0.5, max_new_tokens=512)output = model.tokenizer.decode(output_ids[0])print(output)```
README.md+65-1