Text Generation
Transformers
Safetensors
Bengali
English
gemma3
image-text-to-text
math
reasoning
computational-graph
bangla
low-resource
distractor-aware
sft
small-model
conversational
text-generation-inference
Run this model with HF Jobs
Run dipta007/dagger-4B_SFT 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/dipta007/dagger-4B_SFT. 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/dipta007/dagger-4B_SFT 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/dipta007/dagger-4B_SFT. 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/dipta007/dagger-4B_SFT. 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 dipta007/dagger-4B_SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dipta007/dagger-4B_SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dipta007/dagger-4B_SFT") 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("dipta007/dagger-4B_SFT") model = AutoModelForMultimodalLM.from_pretrained("dipta007/dagger-4B_SFT", 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 dipta007/dagger-4B_SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dipta007/dagger-4B_SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dipta007/dagger-4B_SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dipta007/dagger-4B_SFT
- SGLang
How to use dipta007/dagger-4B_SFT 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 "dipta007/dagger-4B_SFT" \ --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": "dipta007/dagger-4B_SFT", "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 "dipta007/dagger-4B_SFT" \ --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": "dipta007/dagger-4B_SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dipta007/dagger-4B_SFT with Docker Model Runner:
docker model run hf.co/dipta007/dagger-4B_SFT
updated readme
Browse files23 unmodified lines242526272829303141 unmodified lines73747576777879808182838485868788899024 unmodified lines11511611711811923 unmodified lines# DAGGER-4B-SFT<a href="https://arxiv.org/abs/XXXX.XXXXX" target="_blank"><img alt="arXiv" src="https://img.shields.io/badge/arXiv-XXXX.XXXXX-b31b1b" style="display: inline-block; vertical-align: middle;"/></a><a href="https://github.com/dipta007/dagger" target="_blank"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-Code-black" style="display: inline-block; vertical-align: middle;"/>41 unmodified linesdevice_map="auto")question = "মিনার কাছে ১০০টি কলম আছে। প্রতিটি কলমের দাম ৫ টাকা।"messages = [{"role": "system", "content": "You are an expert Bangla Math Reasoner. Solve by constructing a Computational Graph."},{"role": "user", "content": question}]text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)inputs = tokenizer([text], return_tensors="pt").to(model.device)outputs = model.generate(**inputs, max_new_tokens=1024)response = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True)print(response)```24 unmodified lines## Citation```bibtexwill be updated```23 unmodified lines242526272829303141 unmodified lines73747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713824 unmodified lines16316416516616716816917017117217317417523 unmodified lines# DAGGER-4B-SFT<a href="https://arxiv.org/abs/2601.06853" target="_blank"><img alt="arXiv" src="https://img.shields.io/badge/arXiv-2601.06853-b31b1b" style="display: inline-block; vertical-align: middle;"/></a><a href="https://github.com/dipta007/dagger" target="_blank"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-Code-black" style="display: inline-block; vertical-align: middle;"/>41 unmodified linesdevice_map="auto")USER_PROMPT_TEMPLATE = """You are an expert Bengali Math Reasoner. Your task is to solve mathematical problems by constructing a "Computational Graph".### Graph Rules:- `id`: Unique identifier (e.g., "n1", "n2").- `val`: The raw number extracted from text (for input nodes).- `op`: The operation (`add`, `sub`, `mul`, `div`, `round`, `sqrt`, `floor`, `sum`, `mean`, `ratio_split`). Use `const` for input numbers.- `args`: List of input node IDs.- `distractor`: Boolean (`true` / `false`). Set to `true` if the node is NOT used in the final calculation path.- `label`: Label for the node.### Available Operations:- Input: `const` (Use this for all numbers found in text or constants).- Arithmetic: `add`, `sub`, `mul`, `div`, `abs` (absolute difference).- Logic/Stats: `sum`, `mean`, `min` (minimum), `max` (maximum).- Rounding: `round` (nearest int), `floor` (round down), `ceil` (round up).- Advanced: `sqrt`, `pow`, `mod` (remainder), `gcd`, `lcm`.- Output: `identity` ("final_result" points to the answer node)Only output a JSON graph representing the solution, nothing else. Nodes must be topologically sorted, and there must be exactly one "final_result" node that represents the final answer. One example is provided below.### Example:Question:মিনার কাছে ১২২১৯৫ টা কলম আছে। রাজুর কাছে ২৫০৮৪ টা কলম আছে। মিনা রাজুর কাছে ১১২৬ টি কলম চাইল। রাজু ১০০০ টি কলম দিতে রাজি হল, কিন্তু পরে আর দিলেনা। প্রতিটি কলমের দাম ৪৫.৬ টাকা। মিনা যদি কলমগুলো বিক্রি করতে চায়, সে কত টাকা পাবে?Output:```json{{"nodes": [{{"id": "n1", "op": "const", "val": 122195, "distractor": false, "label": "মিনার কলম"}},{{"id": "n2", "op": "const", "val": 25084, "distractor": true, "label": "রাজুর কলম"}},{{"id": "n3", "op": "const", "val": 1126, "distractor": true, "label": "মিনা রাজুর কাছে চাইল"}},{{"id": "n4", "op": "const", "val": 1000, "distractor": true, "label": "রাজু দিতে রাজি হল"}},{{"id": "n5", "op": "const", "val": 45.6, "distractor": false, "label": "প্রতিটি কলমের দাম"}},{{"id": "total_money", "op": "mul", "args": ["n1", "n5"], "distractor": false, "label": "মিনার মোট টাকা"}},{{"id": "final_result", "op": "identity", "args": ["total_money"], "distractor": false, "label": "চূড়ান্ত উত্তর"}}]}}```### Your Task:Question:{question}Output:"""question = "রজারের 5টি টেনিস বল আছে। সে আরও 2 ক্যান টেনিস বল কিনেছে। প্রতিটি ক্যানে 3টি করে টেনিস বল আছে। তার কাছে এখন কতগুলি টেনিস বল আছে?"prompt = USER_PROMPT_TEMPLATE.format(question=question)messages = [{"role": "user", "content": prompt}]text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)inputs = tokenizer(text, return_tensors="pt").to(model.device)# Generateoutputs = model.generate(**inputs, max_new_tokens=1024, temperature=0.7, top_p=0.8)response = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True)print(response)```24 unmodified lines## Citation```bibtex@misc{nazi2026dagdaggerdistractorawaregraphgeneration,title={{\dag}DAGGER: Distractor-Aware Graph Generation for Executable Reasoning in Math Problems},author={Zabir Al Nazi and Shubhashis Roy Dipta and Sudipta Kar},year={2026},eprint={2601.06853},archivePrefix={arXiv},primaryClass={cs.CL},url={https://arxiv.org/abs/2601.06853},}```
README.md+64-8