Instructions to use inclusionAI/LLaDA2.0-flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inclusionAI/LLaDA2.0-flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inclusionAI/LLaDA2.0-flash", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("inclusionAI/LLaDA2.0-flash", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inclusionAI/LLaDA2.0-flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inclusionAI/LLaDA2.0-flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inclusionAI/LLaDA2.0-flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/inclusionAI/LLaDA2.0-flash
- SGLang
How to use inclusionAI/LLaDA2.0-flash 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 "inclusionAI/LLaDA2.0-flash" \ --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": "inclusionAI/LLaDA2.0-flash", "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 "inclusionAI/LLaDA2.0-flash" \ --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": "inclusionAI/LLaDA2.0-flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use inclusionAI/LLaDA2.0-flash with Docker Model Runner:
docker model run hf.co/inclusionAI/LLaDA2.0-flash
Evaluation detail
I was reproducing some of your results last week, i followed the generation config in your description: gen_length 2048, block_length 32, steps 32, temperature 0, eos_early_stop true. For datasets, i use zero-shot across all benchmarks. While i have comparable results on humaneval, gsm8k, the accuracy on arc-c i got is 89%, much lower than your reported 95.93%. Could you please share your detailed setting for evaluation? That would be lots of help.
Hi,
Thanks for your interest in our work and for taking the time to reproduce our results.
You are correct about most of the generation parameters (block_length=32, steps=32, temperature=0, eos_early_stop=True) We should clarify that we used a longer gen_length of 32,768 in our evaluation. However, this is unlikely to be the source of the discrepancy on ARC-c, as its outputs are typically short.
The difference in accuracy might stems from two key parts of our evaluation setup: the prompt template and the answer parsing logic.
1. Prompt Template:
We wrapped the questions in a specific template to guide the model toward the required output format.
QUERY_PREFIX = "Answer the following multiple choice question.\n"
QUERY_SUFFIX = "The last line of your response should be of the following " \
"format: 'Answer: $LETTER' (without quotes) where LETTER is one of ABCD.\n"
messages = [{
"role": "user",
"content": QUERY_PREFIX + "Question: {question}\nA. {textA}\nB. {textB}\nC. {textC}\nD. {textD}\n" + QUERY_SUFFIX,
}]
2. Answer Parsing:
We extract the answer using the first match from the following pattern:
answer_pattern = r"(?i)Answer[ \t]*:[ \t]*\$?([A-D])\$?"
For the sake of completeness, and to ensure you have all the details, it's worth noting that our evaluation script also includes a threshold parameter, which is set to 0.95.
We would appreciate it if you could rerun the evaluation with this template and share the outcome. We look forward to your update.
Thanks for the fast reply, this explains a lot.