Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- Qwen/Qwen2.5-Coder-7B-Instruct
|
| 5 |
+
tags:
|
| 6 |
+
- COBOL generation
|
| 7 |
+
- COBOL-Java translation
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# COBOL-Coder: Domain-Adapted Large Language Models for COBOL Code Generation and Translation
|
| 11 |
+
</div>
|
| 12 |
+
|
| 13 |
+
## Introduction
|
| 14 |
+
|
| 15 |
+
COBOL-Coder is a family of domain-adapted LLMs specialized for COBOL code generation and bidirectional COBOL-Java code translation. Built on top of Qwen2.5-Coder, COBOL-Coder addresses the critical gap in LLM capabilities for legacy programming languages.
|
| 16 |
+
|
| 17 |
+
<!--
|
| 18 |
+
## Model Versions
|
| 19 |
+
|
| 20 |
+
We release XMAiNframe with 7B and 10.5B parameters, including base and instruct models, to the public. XMAiNframe 10.5B is expanded from DeepSeek-Coder 7B by the depth up-scaling method without introducing additional modules or dynamic expert selection methods.
|
| 21 |
+
|
| 22 |
+
<div align="center">
|
| 23 |
+
|
| 24 |
+
| **Model** | **Download** |
|
| 25 |
+
| :-----------------------------: | :----------------------------------------------------------: |
|
| 26 |
+
| XMAiNframe-base-7b | [🤗 HuggingFace](https://https://huggingface.co/Fsoft-AIC/XMAiNframe-base-7b/) |
|
| 27 |
+
| XMAiNframe-instruct-7b | [🤗 HuggingFace](https://huggingface.co/Fsoft-AIC/XMAiNframe-instruct-7b) |
|
| 28 |
+
| XMAiNframe-base-10.5b | [🤗 HuggingFace](https://huggingface.co/Fsoft-AIC/XMAiNframe-base-10.5b) |
|
| 29 |
+
| XMAiNframe-instruct-10.5b | [🤗 HuggingFace](https://huggingface.co/Fsoft-AIC/XMAiNframe-instruct-10.5b) |
|
| 30 |
+
|
| 31 |
+
</div> -->
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
## Quickstart
|
| 35 |
+
|
| 36 |
+
Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 41 |
+
tokenizer = AutoTokenizer.from_pretrained("Fsoft-AIC/COBOL-Coder-7B-Instruct")
|
| 42 |
+
model = AutoModelForCausalLM.from_pretrained("Fsoft-AIC/COBOL-Coder-7B-Instruct")
|
| 43 |
+
|
| 44 |
+
prompt = """Complete the given COBOL code:
|
| 45 |
+
"""
|
| 46 |
+
messages = [
|
| 47 |
+
{"role": "system", "content": "You are a helpful assistant for COBOL generation."},
|
| 48 |
+
{"role": "user", "content": prompt}
|
| 49 |
+
]
|
| 50 |
+
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
| 51 |
+
|
| 52 |
+
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, top_k=50, top_p=0.95, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
|
| 53 |
+
print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
## Additional Information
|
| 57 |
+
### Other Resources:
|
| 58 |
+
- Github: https://github.com/COBOL-Coder/COBOL-Coder
|
| 59 |
+
- Paper: https://arxiv.org/abs/2604.03986
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
### Citation Information
|
| 63 |
+
More details can be found in our [paper](https://arxiv.org/abs/2604.03986).
|
| 64 |
+
|
| 65 |
+
If you're using COBOL-Coder, please cite using this BibTeX:
|
| 66 |
+
```
|
| 67 |
+
@article{dau2026cobol,
|
| 68 |
+
title={COBOL-Coder: Domain-Adapted Large Language Models for COBOL Code Generation and Translation},
|
| 69 |
+
author={Dau, Anh TV and Tan, Shin Hwei and Yang, Jinqiu and Bui, Nghi DQ and Nguyen, Anh Tuan},
|
| 70 |
+
journal={arXiv preprint arXiv:2604.03986},
|
| 71 |
+
year={2026}
|
| 72 |
+
}
|
| 73 |
+
```
|