Downloads · 30 days
33
20% of all-time downloads
zjunlp/OceanGPT-coder-0.6B
OceanGPT-coder-0.6B is a machine learning model from zjunlp. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
<div align="center" <img src="logo.jpg" width="300px"
Downloads · 30 days
33
20% of all-time downloads
All-time downloads
169
Public
Parameters
596M
2.4 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors2.4 GB · 99%
From the Hugging Face model README
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> • </p> </div>OceanGPT-coder-0.6B is based on Qwen3-0.6B 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.md for your reference.
Download the model: zjunlp/OceanGPT-coder-0.6B
git lfs install
git clone https://huggingface.co/zjunlp/OceanGPT-coder-0.6B
or
huggingface-cli download --resume-download zjunlp/OceanGPT-coder-0.6B --local-dir OceanGPT-coder-0.6B --local-dir-use-symlinks False
# Recommended to use Python 3.10 or latest version, PyTorch 2.6 or latest version.
pip install transformers>=4.51.0
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "zjunlp/OceanGPT-coder-0.6B"
device = "auto" # or your divice, e.g., "cuda:0" or "cpu".
# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map=device
)
# prepare the model input
prompt = "请为水下机器人生成MOOS代码,实现如下任务:先回到(50,20)点,然后以(15,20)点为圆形,做半径为30的圆周运动,持续时间200s,速度4 m/s。"
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)
# conduct text completion
generated_ids = model.generate(
**model_inputs,
max_new_tokens=2048,
# temperature=0.6,
# do_sample=True,
# top_p=0.6,
# top_k=50,
# pad_token_id=tokenizer.eos_token_id
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
# parsing thinking content
# try:
# # rindex finding 151668 (</think>)
# index = len(output_ids) - output_ids[::-1].index(151668)
# except ValueError:
# index = 0
# thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
content = tokenizer.decode(output_ids, skip_special_tokens=True).strip("\n")
print(content)
OceanGPT (沧渊) is trained based on the open-sourced large language models including Qwen, MiniCPM, LLaMA.
OceanGPT is trained based on the open-sourced data and tools including Moos, UATD, Forward-looking Sonar Detection Dataset, NKSID, SeabedObjects-KLSG, Marine Debris.
Thanks for their great contributions!
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.
Please cite the following paper if you use OceanGPT in your work.
@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}
}