1wtw1 commited on
Commit
48bf466
·
verified ·
1 Parent(s): dc18f96

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +134 -3
README.md CHANGED
@@ -1,3 +1,134 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pipeline_tag: text-generation
4
+ tags:
5
+ - ocean
6
+ - text-generation-inference
7
+ - oceangpt
8
+ language:
9
+ - en
10
+ - zh
11
+ base_model:
12
+ - Qwen/Qwen3-4B-Thinking-2507
13
+ ---
14
+ <div align="center">
15
+ <img src="logo.jpg" width="300px">
16
+
17
+ **OceanGPT(沧渊): A Large Language Model for Ocean Science Tasks**
18
+
19
+ <p align="center">
20
+ <a href="https://github.com/zjunlp/OceanGPT">Project</a> •
21
+ <a href="https://arxiv.org/abs/2310.02031">Paper</a> •
22
+ <a href="https://huggingface.co/collections/zjunlp/oceangpt-664cc106358fdd9f09aa5157">Models</a> •
23
+ <a href="http://oceangpt.zjukg.cn/">Web</a> •
24
+ <a href="#quickstart">Quickstart</a> •
25
+ <a href="#citation">Citation</a>
26
+ </p>
27
+
28
+ </div>
29
+
30
+ OceanGPT-basic is based on Qwen3 and has been trained on an English and Chinese dataset in the ocean domain (**recent update 20251223**) .
31
+
32
+ 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.
33
+
34
+ - ❗**We will continue to update.**
35
+ - ❗**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.**
36
+
37
+ ## ⏩Quickstart
38
+
39
+ ### Download the model
40
+
41
+ Download the model: [zjunlp/OceanGPT-basic-4B-Thinking](https://huggingface.co/zjunlp/OceanGPT-basic-4B-Thinking)
42
+
43
+ ```
44
+ git lfs install
45
+ git clone https://huggingface.co/zjunlp/OceanGPT-basic-4B-Thinking
46
+ ```
47
+
48
+ or
49
+
50
+ ```
51
+ huggingface-cli download --resume-download zjunlp/OceanGPT-basic-4B-Thinking --local-dir OceanGPT-basic-4B-Thinking --local-dir-use-symlinks False
52
+ ```
53
+
54
+ ### Inference
55
+
56
+ ```python
57
+ from transformers import AutoModelForCausalLM, AutoTokenizer
58
+
59
+ model_name = "Qwen/Qwen3-4B-Thinking-2507"
60
+
61
+ # load the tokenizer and the model
62
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
63
+ model = AutoModelForCausalLM.from_pretrained(
64
+ model_name,
65
+ torch_dtype="auto",
66
+ device_map="auto"
67
+ )
68
+
69
+ # prepare the model input
70
+ system_prompt = "你是海洋知识专家,负责解答各类海洋相关问题(You are a marine knowledge expert, responsible for answering all marine-related questions)."
71
+ question = "<Your Question>"
72
+ messages = [
73
+ {"role": "system", "content": system_prompt},
74
+ {"role": "user", "content": question}
75
+ ]
76
+ text = tokenizer.apply_chat_template(
77
+ messages,
78
+ tokenize=False,
79
+ add_generation_prompt=True,
80
+ )
81
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
82
+
83
+ # conduct text completion
84
+ generated_ids = model.generate(
85
+ **model_inputs,
86
+ max_new_tokens=4096
87
+ )
88
+ output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
89
+
90
+ # parsing thinking content
91
+ try:
92
+ # rindex finding 151668 (</think>)
93
+ index = len(output_ids) - output_ids[::-1].index(151668)
94
+ except ValueError:
95
+ index = 0
96
+
97
+ thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
98
+ content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")
99
+
100
+ print("thinking content:", thinking_content) # no opening <think> tag
101
+ print("content:", content)
102
+
103
+ ```
104
+
105
+ ## 🌻Acknowledgement
106
+
107
+ 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).
108
+
109
+ 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).
110
+
111
+ Thanks for their great contributions!
112
+
113
+ ## Limitations
114
+
115
+ - The model may have hallucination issues.
116
+
117
+ - We did not optimize the identity and the model may generate identity information similar to that of Qwen/MiniCPM/LLaMA/GPT series models.
118
+
119
+ - The model's output is influenced by prompt tokens, which may result in inconsistent results across multiple attempts.
120
+
121
+ - 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.
122
+
123
+ ### 🚩Citation
124
+
125
+ Please cite the following paper if you use OceanGPT in your work.
126
+
127
+ ```bibtex
128
+ @article{bi2023oceangpt,
129
+ title={OceanGPT: A Large Language Model for Ocean Science Tasks},
130
+ author={Bi, Zhen and Zhang, Ningyu and Xue, Yida and Ou, Yixin and Ji, Daxiong and Zheng, Guozhou and Chen, Huajun},
131
+ journal={arXiv preprint arXiv:2310.02031},
132
+ year={2023}
133
+ }
134
+ ```