匿名用户2024年07月31日
39阅读
所属分类ai
开源地址https://modelscope.cn/models/ZJUNLP/OceanGPT-2B-v0.1
授权协议Apache License 2.0

作品详情

**OceanGPT(沧渊): A Large Language Model for Ocean Science Tasks**

ProjectPaperModelsWebQuickstartCitation

OceanGPT-2B-v0.1 is based on MiniCPM-2B and has been trained on a bilingual dataset in the ocean domain, covering both Chinese and English.

⏩Quickstart

Download the model

Download the model

Inference

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
device = "cuda" # the device to load the model onto
path = 'YOUR-MODEL-PATH'
model = AutoModelForCausalLM.from_pretrained(
    path,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(path)

prompt = "Which is the largest ocean in the world?"
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

generated_ids = model.generate(
    model_inputs.input_ids,
    max_new_tokens=512
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]

?Models

Model Name HuggingFace WiseModel ModelScope
OceanGPT-14B-v0.1 (based on Qwen) 14B 14B 14B
OceanGPT-7B-v0.2 (based on Qwen) 7B 7B 7B
OceanGPT-2B-v0.1 (based on MiniCPM) 2B 2B 2B

| OceanGPT-V | To be released | To be released | To be released |

?Acknowledgement

OceanGPT(沧渊) is trained based on the open-sourced large language models including Qwen, MiniCPM, LLaMA. Thanks for their great contributions!

?Citation

Please cite the following paper if you use OceanGPT in your work.

Limitations

  • The model may have hallucination issues.

  • We did not optimize the identity and the model may generate identity information similar to that of Qwen/MiniCPM/LLaMA/GPT series models.

  • The model's output is influenced by prompt tokens, which may result in inconsistent results across multiple attempts.

@article{bi2023oceangpt,
  title={OceanGPT: A Large Language Model for Ocean Science Tasks},
  author={Bi, Zhen and Zhang, Ningyu and Xue, Yida and Ou, Yixin and Ji, Daxiong and Zheng, Guozhou and Chen, Huajun},
  journal={arXiv preprint arXiv:2310.02031},
  year={2023}
}
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论