Update README.md
Browse files
README.md
CHANGED
|
@@ -1,81 +1,137 @@
|
|
| 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/OceanBench
|
| 12 |
-
---
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
)
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
```
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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/OceanBench
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
<div align="center">
|
| 15 |
+
<img src="figs/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/#model">Web</a> •
|
| 24 |
+
<a href="#overview">Overview</a> •
|
| 25 |
+
<a href="#quickstart">Quickstart</a> •
|
| 26 |
+
<a href="#citation">Citation</a>
|
| 27 |
+
</p>
|
| 28 |
+
|
| 29 |
+
[](https://opensource.org/licenses/MIT)
|
| 30 |
+

|
| 31 |
+
|
| 32 |
+
</div>
|
| 33 |
+
|
| 34 |
+
OceanGPT-14B-v0.1 is based on Qwen1.5-14B and has been trained on a bilingual dataset in the ocean domain, covering both Chinese and English.
|
| 35 |
+
|
| 36 |
+
## Table of Contents
|
| 37 |
+
|
| 38 |
+
- <a href="#news">What's New</a>
|
| 39 |
+
- <a href="#overview">Overview</a>
|
| 40 |
+
- <a href="#quickstart">Quickstart</a>
|
| 41 |
+
- <a href="#models">Models</a>
|
| 42 |
+
- <a href="#citation">Citation</a>
|
| 43 |
+
|
| 44 |
+
## 🔔News
|
| 45 |
+
- **2024-07-04, we release OceanGPT-14B/2B-v0.1 and OceanGPT-7B-v0.2 based on Qwen and MiniCPM.**
|
| 46 |
+
- **2024-06-04, [OceanGPT](https://arxiv.org/abs/2310.02031) is accepted by ACL 2024. 🎉🎉**
|
| 47 |
+
- **2023-10-04, we release the paper "[OceanGPT: A Large Language Model for Ocean Science Tasks](https://arxiv.org/abs/2310.02031)" and release OceanGPT-7B-v0.1 based on LLaMA2.**
|
| 48 |
+
- **2023-05-01, we launch the OceanGPT project.**
|
| 49 |
+
---
|
| 50 |
+
|
| 51 |
+
## 🌟Overview
|
| 52 |
+
|
| 53 |
+
This is the OceanGPT project, which aims to build LLMs for ocean science tasks.
|
| 54 |
+
|
| 55 |
+
<div align="center">
|
| 56 |
+
<img src="figs/overview.png" width="60%">
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
## ⏩Quickstart
|
| 60 |
+
### Download the model
|
| 61 |
+
|
| 62 |
+
Download the model: [OceanGPT-14B-v0.1](https://huggingface.co/zjunlp/OceanGPT-14B-v0.1) or [
|
| 63 |
+
OceanGPT-7b-v0.2](https://huggingface.co/zjunlp/OceanGPT-7b-v0.2)
|
| 64 |
+
|
| 65 |
+
```shell
|
| 66 |
+
git lfs install
|
| 67 |
+
git clone https://huggingface.co/zjunlp/OceanGPT-14B-v0.1
|
| 68 |
+
```
|
| 69 |
+
or
|
| 70 |
+
```
|
| 71 |
+
huggingface-cli download --resume-download zjunlp/OceanGPT-14B-v0.1 --local-dir OceanGPT-14B-v0.1 --local-dir-use-symlinks False
|
| 72 |
+
```
|
| 73 |
+
### Inference
|
| 74 |
+
|
| 75 |
+
```python
|
| 76 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 77 |
+
import torch
|
| 78 |
+
device = "cuda" # the device to load the model onto
|
| 79 |
+
path = 'YOUR-MODEL-PATH'
|
| 80 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 81 |
+
path,
|
| 82 |
+
torch_dtype=torch.bfloat16,
|
| 83 |
+
device_map="auto"
|
| 84 |
+
)
|
| 85 |
+
tokenizer = AutoTokenizer.from_pretrained(path)
|
| 86 |
+
|
| 87 |
+
prompt = "Which is the largest ocean in the world?"
|
| 88 |
+
messages = [
|
| 89 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
| 90 |
+
{"role": "user", "content": prompt}
|
| 91 |
+
]
|
| 92 |
+
text = tokenizer.apply_chat_template(
|
| 93 |
+
messages,
|
| 94 |
+
tokenize=False,
|
| 95 |
+
add_generation_prompt=True
|
| 96 |
+
)
|
| 97 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(device)
|
| 98 |
+
|
| 99 |
+
generated_ids = model.generate(
|
| 100 |
+
model_inputs.input_ids,
|
| 101 |
+
max_new_tokens=512
|
| 102 |
+
)
|
| 103 |
+
generated_ids = [
|
| 104 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
| 105 |
+
]
|
| 106 |
+
|
| 107 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
## 📌Models
|
| 111 |
+
|
| 112 |
+
| Model Name | HuggingFace | WiseModel | ModelScope |
|
| 113 |
+
|-------------------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
|
| 114 |
+
| OceanGPT-14B-v0.1 (based on Qwen) | <a href="https://huggingface.co/zjunlp/OceanGPT-14B-v0.1" target="_blank">14B</a> | <a href="https://wisemodel.cn/models/zjunlp/OceanGPT-14B-v0.1" target="_blank">14B</a> | <a href="https://modelscope.cn/models/ZJUNLP/OceanGPT-14B-v0.1" target="_blank">14B</a> |
|
| 115 |
+
| OceanGPT-7B-v0.2 (based on Qwen) | <a href="https://huggingface.co/zjunlp/OceanGPT-7b-v0.2" target="_blank">7B</a> | <a href="https://wisemodel.cn/models/zjunlp/OceanGPT-7b-v0.2" target="_blank">7B</a> | <a href="https://modelscope.cn/models/ZJUNLP/OceanGPT-7b-v0.2" target="_blank">7B</a> |
|
| 116 |
+
| OceanGPT-2B-v0.1 (based on MiniCPM) | <a href="https://huggingface.co/zjunlp/OceanGPT-2B-v0.1" target="_blank">2B</a> | <a href="https://wisemodel.cn/models/zjunlp/OceanGPT-2b-v0.1" target="_blank">2B</a> | <a href="https://modelscope.cn/models/ZJUNLP/OceanGPT-2B-v0.1" target="_blank">2B</a> |
|
| 117 |
+
| OceanGPT-V | To be released | To be released | To be released |
|
| 118 |
+
---
|
| 119 |
+
|
| 120 |
+
## 🌻Acknowledgement
|
| 121 |
+
|
| 122 |
+
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). Thanks for their great contributions!
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
### 🚩Citation
|
| 126 |
+
|
| 127 |
+
Please cite the following paper if you use OceanGPT in your work.
|
| 128 |
+
|
| 129 |
+
```bibtex
|
| 130 |
+
@article{bi2023oceangpt,
|
| 131 |
+
title={OceanGPT: A Large Language Model for Ocean Science Tasks},
|
| 132 |
+
author={Bi, Zhen and Zhang, Ningyu and Xue, Yida and Ou, Yixin and Ji, Daxiong and Zheng, Guozhou and Chen, Huajun},
|
| 133 |
+
journal={arXiv preprint arXiv:2310.02031},
|
| 134 |
+
year={2023}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
```
|