---
title: OceanGPT-coder-7B
canonical_url: "https://www.modelscope.cn/models/ZJUNLP/OceanGPT-coder-7B"
md_url: "https://www.modelscope.cn/models/ZJUNLP/OceanGPT-coder-7B.md"
repository: ZJUNLP/OceanGPT-coder-7B
chinese_name: "沧渊·OceanGPT-7B-coder"
last_updated: 2026-06-15
license: mit
pipeline_tag: text2text-generation
tasks:
  - text2text-generation
model_type:
  - qwen2
architectures:
  - Qwen2ForCausalLM
base_model:
  - Qwen/Qwen2.5-Coder-7B
base_model_relation: finetune
parameters: 7.6B
tensor_type:
  - F32
library_name:
  - transformer
  - safetensors
  - pytorch
frameworks:
  - Pytorch
language:
  - en
  - zh
downloads: 143
stars: 2
---

# OceanGPT-coder-7B

> OceanGPT-coder-7B - ZJUNLP 在 ModelScope 开源的模型。OceanGPT（沧渊）水下具身机器人代码大模型

ZJUNLP/OceanGPT-coder-7B 是 ModelScope 魔搭社区上的 7.6B 参数text2text-generation模型，采用 mit 许可，基于 Qwen/Qwen2.5-Coder-7B 构建。

- **Repository**: ZJUNLP/OceanGPT-coder-7B
- **License**: mit
- **Tasks**: text2text-generation
- **Parameters**: 7.6B
- **Base model**: Qwen/Qwen2.5-Coder-7B
- **Downloads**: 143
- **Stars**: 2
- **Last updated**: 2026-06-15

Source: https://www.modelscope.cn/models/ZJUNLP/OceanGPT-coder-7B

---

<div align="center">
<img src="logo.jpg" width="300px">

**OceanGPT(沧渊): A Large Language Model for Ocean Science Tasks**

<p align="center">
  <a href="https://github.com/zjunlp/OceanGPT">Project</a> •
  <a href="https://arxiv.org/abs/2310.02031">Paper</a> •
  <a href="https://huggingface.co/collections/zjunlp/oceangpt-664cc106358fdd9f09aa5157">Models</a> •
  <a href="http://oceangpt.zjukg.cn/">Web</a> •
  <a href="#quickstart">Quickstart</a> •
  <a href="#citation">Citation</a>
</p>

</div>

OceanGPT-coder is based on Qwen2.5-coder and has been trained on a hybrid synthetic code dataset in `moos` language.

Please note that the models and data in this repository are updated regularly to fix errors. The latest update date will be added to the README for your reference.

- ❗**We will continue to update.**
- ❗**Disclaimer: This project is purely an academic exploration rather than a product. Please be aware that due to the inherent limitations of large language models, there may be issues such as hallucinations.**

## ⏩Quickstart

### Download the model

Download the model: [zjunlp/OceanGPT-coder-7B](https://huggingface.co/zjunlp/OceanGPT-coder-7B)

```
git lfs install
git clone https://huggingface.co/zjunlp/OceanGPT-coder-7B
```

or

```
huggingface-cli download --resume-download zjunlp/OceanGPT-coder-7B --local-dir OceanGPT-coder-7B --local-dir-use-symlinks False
```

### Inference

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
    "zjunlp/OceanGPT-coder-7B", torch_dtype=torch.float16, device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("zjunlp/OceanGPT-coder-7B")
messages = [
    {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
    {"role": "user", "content": "请为水下机器人生成MOOS代码，实现如下任务：先回到（50,20）点，然后以（15,20）点为圆形，做半径为30的圆周运动，持续时间200s，速度4 m/s。"}
]
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,
    top_p=0.6,
    temperature=0.6,
    max_new_tokens=2048
)
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)
```

## 🌻Acknowledgement

OceanGPT (沧渊) is trained based on the open-sourced large language models including [Qwen](https://huggingface.co/Qwen), [MiniCPM](https://huggingface.co/collections/openbmb/minicpm-2b-65d48bf958302b9fd25b698f), [LLaMA](https://huggingface.co/meta-llama).

OceanGPT is trained based on the open-sourced data and tools including [Moos](https://github.com/moos-tutorials), [UATD](https://openi.pcl.ac.cn/OpenOrcinus_orca/URPC2021_sonar_images_dataset), [Forward-looking Sonar Detection Dataset](https://github.com/XingYZhu/Forward-looking-Sonar-Detection-Dataset), [NKSID](https://github.com/Jorwnpay/NK-Sonar-Image-Dataset), [SeabedObjects-KLSG](https://github.com/huoguanying/SeabedObjects-Ship-and-Airplane-dataset), [Marine Debris](https://github.com/mvaldenegro/marine-debris-fls-datasets/tree/master/md_fls_dataset/data/turntable-cropped).

Thanks for their great contributions!

## Limitations

- The model may have hallucination issues.

- Due to limited computational resources, OceanGPT-coder currently only supports machine code in `moos` language. 

- We did not optimize the identity and the model may generate identity information similar to that of Qwen/MiniCPM/LLaMA/GPT series models.

- The model's output is influenced by prompt tokens, which may result in inconsistent results across multiple attempts.

- The model requires the inclusion of specific simulator code instructions for training in order to possess simulated embodied intelligence capabilities (the simulator is subject to copyright restrictions and cannot be made available for now), and its current capabilities are quite limited.

### 🚩Citation

Please cite the following paper if you use OceanGPT in your work.

```bibtex
@article{bi2023oceangpt,
  title={OceanGPT: A Large Language Model for Ocean Science Tasks},
  author={Bi, Zhen and Zhang, Ningyu and Xue, Yida and Ou, Yixin and Ji, Daxiong and Zheng, Guozhou and Chen, Huajun},
  journal={arXiv preprint arXiv:2310.02031},
  year={2023}
}
```
