---
title: Lingma-SWE-GPT-7B
canonical_url: "https://www.modelscope.cn/models/Lingma/Lingma-SWE-GPT-7B"
md_url: "https://www.modelscope.cn/models/Lingma/Lingma-SWE-GPT-7B.md"
repository: Lingma/Lingma-SWE-GPT-7B
chinese_name: "通义灵码软件工程大模型-7B"
last_updated: 2024-10-31
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - qwen2
architectures:
  - Qwen2ForCausalLM
parameters: 7.6B
tensor_type:
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - Pytorch
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 527
stars: 1
---

# Lingma-SWE-GPT-7B

> Lingma-SWE-GPT-7B - Lingma 在 ModelScope 开源的模型。Lingma SWE-GPT (通义灵码软件工程大模型)：面向自动软件工程的大语言模型。通义灵码软件工程大模型是一个专为软件工程任务设计的开源大型语言模型。在 Qwen 系列基础模型的基础上，Lingma SWE-GPT 使用软件工程开发过程数据进行了额外训练，以增强其解决复杂软件工程任务的能力。在权威的 SWE-bench Verified 软件工程智能代理排行榜上实现了 30.20%(72B)和18.20%(7B)…

Lingma/Lingma-SWE-GPT-7B 是 ModelScope 魔搭社区上的 7.6B 参数text-generation模型，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: Lingma/Lingma-SWE-GPT-7B
- **Tasks**: text-generation
- **Parameters**: 7.6B
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 527
- **Stars**: 1
- **Last updated**: 2024-10-31

Source: https://www.modelscope.cn/models/Lingma/Lingma-SWE-GPT-7B

---

# Lingma SWE-GPT: Software Engineering Large Language Model

## Overview

Lingma SWE-GPT is an open-source large language model specifically designed for software engineering tasks. Built upon the foundation of the Qwen series base models, Lingma SWE-GPT has undergone additional training using software engineering development process data to enhance its capabilities in solving complex software engineering tasks.

## Model Introduction

Lingma SWE-GPT is a specialized model that focuses on addressing the unique challenges faced in software engineering. By leveraging the robust capabilities of the Qwen base models and incorporating domain-specific knowledge, this model aims to provide intelligent assistance across various aspects of software development.


## Model Performance

Lingma SWE-GPT has demonstrated impressive performance in software engineering tasks:

- Achieved a **30.20%(72B) and 18.20%(7B) solution rate on the authoritative SWE-bench Verified** leaderboard for software engineering intelligent agents.
- Outperforms other open-source models of similar scale in software engineering-specific tasks.

## How to use

### Run on SWE-bench 
Refer to https://github.com/LingmaTongyi/Lingma-SWE-GPT

### Quick Start
```
from modelscope import AutoModelForCausalLM, AutoTokenizer

model_name = "Lingma/Lingma-SWE-GPT-7B"

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

prompt = "Give me a short introduction to large language model."
messages = [
    {"role": "system", "content": "You are Lingma, created by Tongyi Lingma team. You are a helpful assistant."},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
```

## TODO
Currently only Python is supported. In future updates, we will provide more support for Java, JS/TS and other languages.

## License

This project is licensed under the GNU General Public License v2.0 (GPL-2.0).

## Contact

For any questions or feedback regarding Lingma SWE-GPT, please contact:

mayingwei.myw@alibaba-inc.com

## Acknowledgments

We would like to thank the Qwen team for their foundational work, which has been instrumental in the development of Lingma SWE-GPT.

## Citation
```
@article{ma2024understand,
  title={How to Understand Whole Software Repository?},
  author={Ma, Yingwei and Yang, Qingping and Cao, Rongyu and Li, Binhua and Huang, Fei and Li, Yongbin},
  journal={arXiv preprint arXiv:2406.01422},
  year={2024}
}
```
