---
title: CodeFormulaV2
canonical_url: "https://www.modelscope.cn/models/ds4sd/CodeFormulaV2"
md_url: "https://www.modelscope.cn/models/ds4sd/CodeFormulaV2.md"
repository: ds4sd/CodeFormulaV2
last_updated: 2025-08-11
license: cdla-permissive-2.0
model_type:
  - idefics3
architectures:
  - Idefics3ForConditionalGeneration
parameters: 315.5M
tensor_type:
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - pytorch
inference_backends:
  - "deploy_task vlm/text/emb"
  - "vllm 0.9.2"
downloads: 1049
stars: 0
tags:
  - ocr
  - code
  - math
  - formula
---

# CodeFormulaV2

> CodeFormulaV2 - ds4sd 在 ModelScope 开源的模型。The Code Formula Model processes an image of a code snippet or formula at 120 DPI and outputs its content.

ds4sd/CodeFormulaV2 是 ModelScope 魔搭社区上的 315.5M 参数机器学习模型，采用 cdla-permissive-2.0 许可，可用 deploy_task vlm/text/emb、vllm 0.9.2 部署。

- **Repository**: ds4sd/CodeFormulaV2
- **License**: cdla-permissive-2.0
- **Parameters**: 315.5M
- **Inference backends**: deploy_task vlm/text/emb, vllm 0.9.2
- **Tags**: ocr, code, math, formula
- **Downloads**: 1049
- **Stars**: 0
- **Last updated**: 2025-08-11

Source: https://www.modelscope.cn/models/ds4sd/CodeFormulaV2

---

# Code Formula Model

The **Code Formula Model** processes an image of a code snippet or formula at 120 DPI and outputs its content.

- **Code Snippets**:  
  The model identifies the programming language and outputs the code repsecting the indendation shown in the given image. The output format will be:<br>
  "<\_\<programming language\>\_> \<content of the image\>"<br>
  Example:<br>
  "<_Java_> System.out.println("Hello World.");"

- **Formulas**:  
  The model generates the corresponding LaTeX code.


This model was trained using the following two datasets:
1. https://huggingface.co/datasets/ds4sd/SynthFormulaNet
2. https://huggingface.co/datasets/ds4sd/SynthCodeNet

# References
```bibtex
@techreport{Docling,
  author = {Deep Search Team},
  month = {8},
  title = {{Docling Technical Report}},
  url={https://arxiv.org/abs/2408.09869},
  eprint={2408.09869},
  doi = "10.48550/arXiv.2408.09869",
  version = {1.0.0},
  year = {2024}
}

@article{nassar2025smoldocling,
  title={SmolDocling: An ultra-compact vision-language model for end-to-end multi-modal document conversion},
  author={Nassar, Ahmed and Marafioti, Andres and Omenetti, Matteo and Lysak, Maksym and Livathinos, Nikolaos and Auer, Christoph and Morin, Lucas and de Lima, Rafael Teixeira and Kim, Yusik and Gurbuz, A Said and others},
  journal={arXiv preprint arXiv:2503.11576},
  year={2025}
}

```
