xyd123 commited on
Commit
52db05a
·
1 Parent(s): 0cd04f1
Files changed (2) hide show
  1. .gitattributes +0 -1
  2. README.md +138 -3
.gitattributes CHANGED
@@ -35,7 +35,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  chat_template.json filter=lfs diff=lfs merge=lfs -text
37
  model.safetensors.index.json filter=lfs diff=lfs merge=lfs -text
38
- README.md filter=lfs diff=lfs merge=lfs -text
39
  special_tokens_map.json filter=lfs diff=lfs merge=lfs -text
40
  config.json filter=lfs diff=lfs merge=lfs -text
41
  generation_config.json filter=lfs diff=lfs merge=lfs -text
 
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  chat_template.json filter=lfs diff=lfs merge=lfs -text
37
  model.safetensors.index.json filter=lfs diff=lfs merge=lfs -text
 
38
  special_tokens_map.json filter=lfs diff=lfs merge=lfs -text
39
  config.json filter=lfs diff=lfs merge=lfs -text
40
  generation_config.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,138 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:9f5c48dc63cf7e7626f7a95d410f932e6679d9f6accc9c56372d64f9c06ea1d9
3
- size 5078
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pipeline_tag: text-generation
4
+ tags:
5
+ - ocean
6
+ - text-generation-inference
7
+ - oceangpt
8
+ language:
9
+ - en
10
+ datasets:
11
+ - zjunlp/OceanInstruct
12
+ ---
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-o is based on Qwen2.5-VL and has been trained on an English and Chinese dataset in the ocean domain.
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-o-7B](https://huggingface.co/zjunlp/OceanGPT-o-7B)
40
+
41
+ ```
42
+ git lfs install
43
+ git clone https://huggingface.co/zjunlp/OceanGPT-o-7B
44
+ ```
45
+
46
+ or
47
+
48
+ ```
49
+ huggingface-cli download --resume-download zjunlp/OceanGPT-o-7B --local-dir OceanGPT-o-7B --local-dir-use-symlinks False
50
+ ```
51
+
52
+ Qwen2.5-VL offers a toolkit to help you handle various types of visual input more conveniently, as if you were using an API. This includes base64, URLs, and interleaved images and videos. You can install it using the following command:
53
+
54
+ ```
55
+ # It's highly recommanded to use `[decord]` feature for faster video loading.
56
+ pip install qwen-vl-utils[decord]==0.0.8
57
+ ```
58
+
59
+ ### Inference
60
+
61
+ ```python
62
+ from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor
63
+ from qwen_vl_utils import process_vision_info
64
+
65
+ model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
66
+ "zjunlp/OceanGPT-o-7B", torch_dtype=torch.bfloat16, device_map="auto"
67
+ )
68
+ processor = AutoProcessor.from_pretrained("zjunlp/OceanGPT-o-7B")
69
+
70
+ messages = [
71
+ {
72
+ "role": "user",
73
+ "content": [
74
+ {
75
+ "type": "image",
76
+ "image": "file:///path/to/your/image.jpg",
77
+ },
78
+ {"type": "text", "text": "Describe this image."},
79
+ ],
80
+ }
81
+ ]
82
+
83
+ text = processor.apply_chat_template(
84
+ messages, tokenize=False, add_generation_prompt=True
85
+ )
86
+ image_inputs, video_inputs = process_vision_info(messages)
87
+ inputs = processor(
88
+ text=[text],
89
+ images=image_inputs,
90
+ videos=video_inputs,
91
+ padding=True,
92
+ return_tensors="pt",
93
+ )
94
+ inputs = inputs.to("cuda")
95
+
96
+ generated_ids = model.generate(**inputs, max_new_tokens=128)
97
+ generated_ids_trimmed = [
98
+ out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
99
+ ]
100
+ output_text = processor.batch_decode(
101
+ generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
102
+ )
103
+
104
+ print(output_text)
105
+ ```
106
+
107
+ ## 🌻Acknowledgement
108
+
109
+ 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).
110
+
111
+ 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).
112
+
113
+ Thanks for their great contributions!
114
+
115
+ ## Limitations
116
+
117
+ - The model may have hallucination issues.
118
+
119
+ - Due to limited computational resources, OceanGPT-o currently only supports natural language generation for certain types of sonar images and ocean science images.
120
+
121
+ - We did not optimize the identity and the model may generate identity information similar to that of Qwen/MiniCPM/LLaMA/GPT series models.
122
+
123
+ - The model's output is influenced by prompt tokens, which may result in inconsistent results across multiple attempts.
124
+
125
+ - 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.
126
+
127
+ ### 🚩Citation
128
+
129
+ Please cite the following paper if you use OceanGPT in your work.
130
+
131
+ ```bibtex
132
+ @article{bi2023oceangpt,
133
+ title={OceanGPT: A Large Language Model for Ocean Science Tasks},
134
+ author={Bi, Zhen and Zhang, Ningyu and Xue, Yida and Ou, Yixin and Ji, Daxiong and Zheng, Guozhou and Chen, Huajun},
135
+ journal={arXiv preprint arXiv:2310.02031},
136
+ year={2023}
137
+ }
138
+ ```