xyd123 commited on
Commit
8fbc104
β€’
1 Parent(s): 9daaf21

new readme

Browse files
Files changed (1) hide show
  1. README.md +79 -54
README.md CHANGED
@@ -1,55 +1,80 @@
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
- ## πŸ’‘ Model description
15
- This repo contains a large language model (OceanGPT) for ocean science tasks trained with [KnowLM](https://github.com/zjunlp/KnowLM).
16
- It should be noted that the OceanGPT is constantly being updated, so the current model is not the final version.
17
-
18
- OceanGPT-2B is based on Llama3 and trained on a bilingual dataset in Chinese and English.
19
- ## πŸ” Intended uses
20
- You can download the model to generate responses or contact the [email](bizhen_zju@zju.edu.cn) for the online test demo.
21
-
22
- ## πŸ› οΈ How to use OceanGPT
23
- We wil provide several examples soon and you can modify the input according to your needs.
24
-
25
- ```python
26
- from transformers import AutoModelForCausalLM, AutoTokenizer
27
- import torch
28
-
29
- path = 'zjunlp/OceanGPT-8B-v0.1'
30
- tokenizer = AutoTokenizer.from_pretrained(path)
31
- model = AutoModelForCausalLM.from_pretrained(path, torch_dtype=torch.bfloat16, device_map='cuda', trust_remote_code=True)
32
- ```
33
-
34
- ## πŸ› οΈ How to evaluate your model in OceanBench
35
-
36
- We wil provide several examples soon and you can modify the input according to your needs.
37
-
38
- *Note: We are conducting the final checks on OceanBench and will be uploading it to Hugging Face soon.
39
-
40
- ```python
41
- >>> from datasets import load_dataset
42
-
43
- >>> dataset = load_dataset("zjunlp/OceanBench")
44
- ```
45
-
46
- ## πŸ“š How to cite
47
-
48
- ```bibtex
49
- @article{bi2023oceangpt,
50
- title={OceanGPT: A Large Language Model for Ocean Science Tasks},
51
- author={Bi, Zhen and Zhang, Ningyu and Xue, Yida and Ou, Yixin and Ji, Daxiong and Zheng, Guozhou and Chen, Huajun},
52
- journal={arXiv preprint arXiv:2310.02031},
53
- year={2023}
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  ```
 
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
+ ## πŸ’‘ Model description
15
+ This repo contains a large language model (OceanGPT) for ocean science tasks trained with [KnowLM](https://github.com/zjunlp/KnowLM).
16
+ It should be noted that the OceanGPT is constantly being updated, so the current model is not the final version.
17
+
18
+ OceanGPT-14B is based on Qwen1.5-14B and trained on a bilingual dataset in Chinese and English.
19
+ ## πŸ” Intended uses
20
+ You can download the model to generate responses or contact the [email](bizhen_zju@zju.edu.cn) for the online test demo.
21
+
22
+ ## πŸ› οΈ How to use OceanGPT
23
+ We wil provide several examples soon and you can modify the input according to your needs.
24
+
25
+ ```python
26
+ from transformers import AutoModelForCausalLM, AutoTokenizer
27
+ device = "cuda" # the device to load the model onto
28
+
29
+ model = AutoModelForCausalLM.from_pretrained(
30
+ "zjunlp/OceanGPT-14B-v0.1",
31
+ torch_dtype="auto",
32
+ device_map="auto"
33
+ )
34
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen1.5-14B-Chat")
35
+
36
+ prompt = "Which is the largest ocean in the world?"
37
+ messages = [
38
+ {"role": "system", "content": "You are a helpful assistant."},
39
+ {"role": "user", "content": prompt}
40
+ ]
41
+ text = tokenizer.apply_chat_template(
42
+ messages,
43
+ tokenize=False,
44
+ add_generation_prompt=True
45
+ )
46
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
47
+
48
+ generated_ids = model.generate(
49
+ model_inputs.input_ids,
50
+ max_new_tokens=512
51
+ )
52
+ generated_ids = [
53
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
54
+ ]
55
+
56
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
57
+ ```
58
+
59
+ ## πŸ› οΈ How to evaluate your model in OceanBench
60
+
61
+ We wil provide several examples soon and you can modify the input according to your needs.
62
+
63
+ *Note: We are conducting the final checks on OceanBench and will be uploading it to Hugging Face soon.
64
+
65
+ ```python
66
+ >>> from datasets import load_dataset
67
+
68
+ >>> dataset = load_dataset("zjunlp/OceanBench")
69
+ ```
70
+
71
+ ## πŸ“š How to cite
72
+
73
+ ```bibtex
74
+ @article{bi2023oceangpt,
75
+ title={OceanGPT: A Large Language Model for Ocean Science Tasks},
76
+ author={Bi, Zhen and Zhang, Ningyu and Xue, Yida and Ou, Yixin and Ji, Daxiong and Zheng, Guozhou and Chen, Huajun},
77
+ journal={arXiv preprint arXiv:2310.02031},
78
+ year={2023}
79
+ }
80
  ```