ShawnRu commited on
Commit
f2d7b7d
·
verified ·
1 Parent(s): d837ce5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +128 -1
README.md CHANGED
@@ -7,4 +7,131 @@ base_model:
7
  - Qwen/Qwen3-0.6B
8
  tags:
9
  - code
10
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  - Qwen/Qwen3-0.6B
8
  tags:
9
  - code
10
+ ---
11
+
12
+
13
+ <div align="center">
14
+ <img src="logo.jpg" width="300px">
15
+
16
+ **OceanGPT(沧渊): A Large Language Model for Ocean Science Tasks**
17
+
18
+ <p align="center">
19
+ <a href="https://github.com/zjunlp/OceanGPT">Project</a> •
20
+ <a href="https://arxiv.org/abs/2310.02031">Paper</a> •
21
+ <a href="https://huggingface.co/collections/zjunlp/oceangpt-664cc106358fdd9f09aa5157">Models</a> •
22
+ <a href="http://oceangpt.zjukg.cn/">Web</a> •
23
+ <a href="#quickstart">Quickstart</a> •
24
+ <a href="#citation">Citation</a>
25
+ </p>
26
+ </div>
27
+
28
+ OceanGPT-coder-0.6B is based on Qwen3-0.6B and has been trained on a hybrid synthetic code dataset in `moos` language.
29
+
30
+ 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.
31
+
32
+ - ❗**We will continue to update.**
33
+ - ❗**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.**
34
+
35
+ ## ⏩Quickstart
36
+
37
+ ### Download the model
38
+
39
+ Download the model: [zjunlp/OceanGPT-coder-0.6B](https://huggingface.co/zjunlp/OceanGPT-coder-0.6B)
40
+
41
+ ```bash
42
+ git lfs install
43
+ git clone https://huggingface.co/zjunlp/OceanGPT-coder-0.6B
44
+ ```
45
+
46
+ or
47
+
48
+ ```bash
49
+ huggingface-cli download --resume-download zjunlp/OceanGPT-coder-0.6B --local-dir OceanGPT-coder-0.6B --local-dir-use-symlinks False
50
+ ```
51
+
52
+ ### Inference
53
+
54
+ ```python
55
+ from modelscope import AutoModelForCausalLM, AutoTokenizer
56
+
57
+ model_name = "zjunlp/OceanGPT-coder-0.6B"
58
+ device = "auto" # or your divice, e.g., "cuda:0" or "cpu".
59
+
60
+ # load the tokenizer and the model
61
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
62
+ model = AutoModelForCausalLM.from_pretrained(
63
+ model_name,
64
+ torch_dtype="auto",
65
+ device_map=device
66
+ )
67
+
68
+ # prepare the model input
69
+ prompt = "请为水下机器人生成MOOS代码,实现如下任务:先回到(50,20)点,然后以(15,20)点为圆形,做半径为30的圆周运动,持续时间200s,速度4 m/s。"
70
+ messages = [
71
+ {"role": "user", "content": prompt}
72
+ ]
73
+ text = tokenizer.apply_chat_template(
74
+ messages,
75
+ tokenize=False,
76
+ add_generation_prompt=True,
77
+ enable_thinking=False
78
+ )
79
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
80
+
81
+ # conduct text completion
82
+ generated_ids = model.generate(
83
+ **model_inputs,
84
+ max_new_tokens=2048,
85
+ # temperature=0.6,
86
+ # do_sample=True,
87
+ # top_p=0.6,
88
+ # top_k=50,
89
+ # pad_token_id=tokenizer.eos_token_id
90
+ )
91
+ output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
92
+
93
+ # parsing thinking content
94
+ # try:
95
+ # # rindex finding 151668 (</think>)
96
+ # index = len(output_ids) - output_ids[::-1].index(151668)
97
+ # except ValueError:
98
+ # index = 0
99
+
100
+ # thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
101
+ content = tokenizer.decode(output_ids, skip_special_tokens=True).strip("\n")
102
+
103
+ print(content)
104
+ ```
105
+
106
+ ## 🌻Acknowledgement
107
+
108
+ 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).
109
+
110
+ 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).
111
+
112
+ Thanks for their great contributions!
113
+
114
+ ## Limitations
115
+
116
+ - The model may have hallucination issues.
117
+
118
+ - Due to limited computational resources, OceanGPT-coder currently only supports machine code in `moos` language.
119
+
120
+ - We did not optimize the identity and the model may generate identity information similar to that of Qwen/MiniCPM/LLaMA/GPT series models.
121
+
122
+ - The model's output is influenced by prompt tokens, which may result in inconsistent results across multiple attempts.
123
+
124
+ - 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.
125
+
126
+ ### 🚩Citation
127
+
128
+ Please cite the following paper if you use OceanGPT in your work.
129
+
130
+ ```bibtex
131
+ @article{bi2023oceangpt,
132
+ title={OceanGPT: A Large Language Model for Ocean Science Tasks},
133
+ author={Bi, Zhen and Zhang, Ningyu and Xue, Yida and Ou, Yixin and Ji, Daxiong and Zheng, Guozhou and Chen, Huajun},
134
+ journal={arXiv preprint arXiv:2310.02031},
135
+ year={2023}
136
+ }
137
+ ```