{"id":28676526,"url":"https://github.com/zjunlp/oceangpt","last_synced_at":"2025-08-04T08:36:07.811Z","repository":{"id":247607779,"uuid":"791368043","full_name":"zjunlp/OceanGPT","owner":"zjunlp","description":"[沧渊] [ACL 2024] OceanGPT: A Large Language Model for Ocean Science Tasks","archived":false,"fork":false,"pushed_at":"2025-05-23T15:17:48.000Z","size":40279,"stargazers_count":53,"open_issues_count":1,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-23T16:52:37.058Z","etag":null,"topics":["artificial-intelligence","cangyuan","large-language-models","machine-learning","marine","multimodal-large-language-models","natural-language-processing","ocean-science","oceanbench","oceangpt","oceaninstructions","oceanography"],"latest_commit_sha":null,"homepage":"http://OceanGPT.blue/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zjunlp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-24T15:36:51.000Z","updated_at":"2025-05-23T15:17:52.000Z","dependencies_parsed_at":"2024-07-18T05:40:51.180Z","dependency_job_id":"af199b74-8aa6-4532-914d-b50097ef12b4","html_url":"https://github.com/zjunlp/OceanGPT","commit_stats":null,"previous_names":["zjunlp/oceangpt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zjunlp/OceanGPT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjunlp%2FOceanGPT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjunlp%2FOceanGPT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjunlp%2FOceanGPT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjunlp%2FOceanGPT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zjunlp","download_url":"https://codeload.github.com/zjunlp/OceanGPT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjunlp%2FOceanGPT/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259732771,"owners_count":22903087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","cangyuan","large-language-models","machine-learning","marine","multimodal-large-language-models","natural-language-processing","ocean-science","oceanbench","oceangpt","oceaninstructions","oceanography"],"created_at":"2025-06-13T23:04:59.954Z","updated_at":"2025-08-04T08:36:07.795Z","avatar_url":"https://github.com/zjunlp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"http://oceangpt.ORG/\"\u003e\u003cimg src=\"figs/logo.jpg\" width=\"300px\" \u003e\u003c/a\u003e\n\n\u003ca href=\"http://oceangpt.ORG/\" style=\"text-decoration: none;\"\u003e**沧渊海洋基础大模型：Ocean Foundation Models**\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/zjunlp/OceanGPT\"\u003eProject\u003c/a\u003e •\n  \u003ca href=\"https://arxiv.org/abs/2310.02031\"\u003ePaper\u003c/a\u003e •\n  \u003ca href=\"https://huggingface.co/collections/zjunlp/oceangpt-664cc106358fdd9f09aa5157\"\u003eModels\u003c/a\u003e •\n  \u003ca href=\"http://oceangpt.ORG/\"\u003eWeb\u003c/a\u003e •\n  \u003ca href=\"https://ajar-mayflower-ac1.notion.site/OceanGPT-1f8204ef4eed80db8842c3925dc9b814\"\u003eManual\u003c/a\u003e •\n  \u003ca href=\"#overview\"\u003eOverview\u003c/a\u003e •\n  \u003ca href=\"#quickstart\"\u003eQuickstart\u003c/a\u003e •\n  \u003ca href=\"#citation\"\u003eCitation\u003c/a\u003e\n\u003c/p\u003e\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n![](https://img.shields.io/badge/PRs-Welcome-red)\n\n\n\u003c/div\u003e\n\n---\n\n**✨ [OceanGPT Beginner's Guide ](https://ajar-mayflower-ac1.notion.site/OceanGPT-1f8204ef4eed80db8842c3925dc9b814)officially published!**\n\nWe have published a detailed beginner's guide for OceanGPT, which will help you quickly grasp the model’s capabilities and begin applying this ocean-focused large model in your work.\n\n\u003e [!IMPORTANT]\n\u003e We regularly **update our open-source models**, so their capabilities may differ from previous versions. We warmly welcome your feedback to help us continuously improve the application of LLMs in the ocean domain.\n\n## Table of Contents\n\n- \u003ca href=\"#news\"\u003eWhat's New\u003c/a\u003e\n- \u003ca href=\"#overview\"\u003eOverview\u003c/a\u003e\n- \u003ca href=\"#quickstart\"\u003eQuickstart\u003c/a\u003e\n- \u003ca href=\"#chat-with-our-demo-on-gradio\"\u003e 🤗Chat with Our Demo on Gradio\u003c/a\u003e\n- \u003ca href=\"#fine-tuning-oceangpt-for-building-customized-qa-applications\"\u003eFine-tuning OceanGPT for Building Customized QA Applications\u003c/a\u003e\n- \u003ca href=\"#using-mcp-server-for-sonar-image-caption\"\u003eUsing MCP Server for Sonar Image Caption\u003c/a\u003e\n- \u003ca href=\"#inference\"\u003eInference\u003c/a\u003e\n    - \u003ca href=\"#models\"\u003eModels\u003c/a\u003e\n    - \u003ca href=\"#efficient-inference-with-sglang-vllm-ollama-llamacpp\"\u003eEfficient Inference with sglang, vLLM, ollama, llama.cpp\u003c/a\u003e\n- \u003ca href=\"#acknowledgement\"\u003eAcknowledgement\u003c/a\u003e\n- \u003ca href=\"#limitations\"\u003eLimitations\u003c/a\u003e\n- \u003ca href=\"#citation\"\u003eCitation\u003c/a\u003e\n\n## 🔔News\n- **2025-06-17, we release the OceanGPT-coder-0.6B.**\n- **2025-05-29, we deploy the OceanGPT MCP Server to support sonar image interpretation.**\n- **2025-04-20, we release the OceanGPT-o-7B and OceanGPT-coder-7B.**\n- **2025-02-01, we collect sonar data for model training and test OceanGPT-coder.**\n- **2024-12-01, we collect more publicly available sonar data and scientific images for model training.**\n- **2024-08-01, we launch bilingual (Chinese-English) multimodal large language model OceanGPT-o with sonar and ocean science image data collection and training.**\n- **2024-07-04, we release the OceanGPT-basic-14B/2B and the updated version of OceanGPT-basic-7B (v0.2).**\n- **2024-06-04, [OceanGPT](https://arxiv.org/abs/2310.02031) is accepted by ACL 2024. 🎉🎉**\n- **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-basic-7B (v0.1) based on LLaMA2.**\n- **2023-05-01, we launch the OceanGPT (沧渊) project.**\n---\n\n### Models\n\n| Model Name        |        ModelScope                                                                                                              | HuggingFace                                                               |\n|-------------------|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|\n| OceanGPT-o-7B (based on Qwen, **recommended**)                      |\u003ca href=\"https://modelscope.cn/models/ZJUNLP/OceanGPT-o-7B\" target=\"_blank\"\u003e7B\u003c/a\u003e   | \u003ca href=\"https://huggingface.co/zjunlp/OceanGPT-o-7B\" target=\"_blank\"\u003e7B\u003c/a\u003e |\n| OceanGPT-coder-7B (based on Qwen, **recommended**)                                                                      | \u003ca href=\"https://modelscope.cn/models/ZJUNLP/OceanGPT-coder-7B\" target=\"_blank\"\u003e7B\u003c/a\u003e                                                                        | \u003ca href=\"https://huggingface.co/zjunlp/OceanGPT-coder-7B\" target=\"_blank\"\u003e7B\u003c/a\u003e\n| OceanGPT-basic-8B (based on Qwen, **recommended**) |\u003ca href=\"https://www.modelscope.cn/models/ZJUNLP/OceanGPT-basic-8B\" target=\"_blank\"\u003e8B\u003c/a\u003e   | \u003ca href=\"https://huggingface.co/zjunlp/OceanGPT-basic-8B\" target=\"_blank\"\u003e8B\u003c/a\u003e |\n| OceanGPT-basic-14B (based on Qwen, legacy) |\u003ca href=\"https://modelscope.cn/models/ZJUNLP/OceanGPT-14B-v0.1\" target=\"_blank\"\u003e14B\u003c/a\u003e   | \u003ca href=\"https://huggingface.co/zjunlp/OceanGPT-14B-v0.1\" target=\"_blank\"\u003e14B\u003c/a\u003e |\n| OceanGPT-basic-7B (based on Qwen, legacy) |  \u003ca href=\"https://modelscope.cn/models/ZJUNLP/OceanGPT-7b-v0.2\" target=\"_blank\"\u003e7B\u003c/a\u003e    |  \u003ca href=\"https://huggingface.co/zjunlp/OceanGPT-7b-v0.2\" target=\"_blank\"\u003e7B\u003c/a\u003e   |\n| OceanGPT-basic-2B (based on MiniCPM, legacy) | \u003ca href=\"https://modelscope.cn/models/ZJUNLP/OceanGPT-2B-v0.1\" target=\"_blank\"\u003e2B\u003c/a\u003e    |  \u003ca href=\"https://huggingface.co/zjunlp/OceanGPT-2B-v0.1\" target=\"_blank\"\u003e2B\u003c/a\u003e   |\n| OceanGPT-coder-0.6B (based on Qwen3) | \u003ca href=\"https://www.modelscope.cn/models/ZJUNLP/OceanGPT-coder-0.6B\" target=\"_blank\"\u003e0.6B\u003c/a\u003e    |  \u003ca href=\"https://huggingface.co/zjunlp/OceanGPT-coder-0.6B\" target=\"_blank\"\u003e0.6B\u003c/a\u003e   |\n\n---\n\n- ❗**Please note that the ocean domain Q\u0026A in the online demo system (including the video) is based on knowledge base augmentation and a \"general-specialized integration\" approach, and the generated content differs from that of the open-source models (注意：在线演示系统和视频里的海洋专业问答采用了知识增强与通专结合等技术，因此和开源模型存在差异)！**\n- ❗**Due to limited computing resources, OceanGPT-o is currently only applicable for natural language interpretation and generation of certain types of sonar images and marine science images. It is recommended to use a GPU that is greater than or equal to 24GB.**\n\n### Instruction Data\n\n| Data Name        | HuggingFace                                                                                                                    | ModelScope                                                                |\n|-------------------|----------------------------------------------------------------------------------- |-----------------------------------------------------------------------------------------|\n| OceanInstruct-v0.2  | \u003ca href=\"https://huggingface.co/datasets/zjunlp/OceanInstruct-v0.2\" target=\"_blank\"\u003e50K\u003c/a\u003e   | \u003ca href=\"https://modelscope.cn/datasets/ZJUNLP/OceanInstruct-v0.2\" target=\"_blank\"\u003e50K\u003c/a\u003e |\n| OceanInstruct-o  | \u003ca href=\"https://huggingface.co/datasets/zjunlp/OceanInstruct-o\" target=\"_blank\"\u003e50K\u003c/a\u003e  | \u003ca href=\"https://modelscope.cn/datasets/ZJUNLP/OceanInstruct-o\" target=\"_blank\"\u003e50K\u003c/a\u003e |\n| OceanInstruct-v0.1  | \u003ca href=\"https://huggingface.co/datasets/zjunlp/OceanInstruct-v0.1\" target=\"_blank\"\u003e10K\u003c/a\u003e  | \u003ca href=\"https://modelscope.cn/datasets/ZJUNLP/OceanInstruct-v0.1\" target=\"_blank\"\u003e10K\u003c/a\u003e |\n---\n- ❗**Some of the instruction data are synthetic data; we apologize for any inaccuracies that may exist (部分指令数据为合成数据，如存在错误敬请谅解)！**\n\n## 🌟Overview\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"figs/overview.png\" width=\"60%\"\u003e\n\u003c/div\u003e\n\nThis is the OceanGPT (沧渊) project, which aims to build ocean foundation model.\n\n\n## ⏩Quickstart\n\n```\nconda create -n py3.11 python=3.11\nconda activate py3.11\npip install -r requirements.txt\n```\n\n### Download the model\n#### Download from HuggingFace\n```shell\n# use git lfs\ngit lfs install\ngit clone https://huggingface.co/zjunlp/OceanGPT-o-7B\n```\nor\n```shell\n# use huggingface-cli\npip install -U huggingface_hub\nhuggingface-cli download --resume-download zjunlp/OceanGPT-o-7B --local-dir OceanGPT-o-7B --local-dir-use-symlinks False\n```\n\u003c!-- #### Download from WiseModel\n```shell\ngit lfs install\ngit clone https://www.wisemodel.cn/zjunlp/OceanGPT-14B-v0.1.git\n``` --\u003e\n#### Download from ModelScope\n```shell\n# use git lfs\ngit lfs install\ngit clone https://www.modelscope.cn/ZJUNLP/OceanGPT-o-7B.git\n```\nor\n```shell\n# use modelscope\npip install modelscope\nmodelscope download --model ZJUNLP/OceanGPT-o-7B\n```\n\n### Inference\n#### OceanGPT-basic-8B\n```python\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nmodel_name = \"zjunlp/OceanGPT-basic-8B\"\n\n# load the tokenizer and the model\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(\n    model_name,\n    torch_dtype=\"auto\",\n    device_map=\"auto\"\n)\n\nquestion = \"\u003cYour Question\u003e\"\nmessages = [\n    {\"role\": \"user\", \"content\": question}\n]\n\ntext = tokenizer.apply_chat_template(\n    messages,\n    tokenize=False,\n    add_generation_prompt=True,\n    enable_thinking=False \n)\n\nmodel_inputs = tokenizer([text], return_tensors=\"pt\").to(model.device)\n\ngenerated_ids = model.generate(\n    **model_inputs,\n    max_new_tokens=8192\n)\noutput_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist() \n\ntry:\n    index = len(output_ids) - output_ids[::-1].index(151668)  # \u003c/think\u003e token ID\nexcept ValueError:\n    index = 0\n\ncontent = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip(\"\\n\")\nprint(content)\n```\n\n#### OceanGPT-o-7B\n```shell\n# It's highly recommanded to use `[decord]` feature for faster video loading.\npip install qwen-vl-utils[decord]==0.0.8\npip install transformers\n```\n```python\nfrom transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, Qwen2VLProcessor\nfrom qwen_vl_utils import process_vision_info\nimport torch\n\nmodel = Qwen2_5_VLForConditionalGeneration.from_pretrained(\n    \"zjunlp/OceanGPT-o-7B\", torch_dtype=torch.bfloat16, device_map=\"auto\"\n)\nprocessor = Qwen2VLProcessor.from_pretrained(\"zjunlp/OceanGPT-o-7B\")\n\nmessages = [\n    {\n        \"role\": \"user\",\n        \"content\": [\n            {\n                \"type\": \"image\",\n                \"image\": \"file:///path/to/your/image.jpg\",\n            },\n            {\"type\": \"text\", \"text\": \"Describe this image.\"},\n        ],\n    }\n]\n\ntext = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)\nimage_inputs, video_inputs = process_vision_info(messages)\ninputs = processor(\n    text=[text],\n    images=image_inputs,\n    videos=video_inputs,\n    padding=True,\n    return_tensors=\"pt\",\n)\ninputs = inputs.to(\"cuda\")\n\n\ngenerated_ids = model.generate(**inputs, max_new_tokens=128)\ngenerated_ids_trimmed = [\n    out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)\n]\noutput_text = processor.batch_decode(\n    generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False\n)\nprint(output_text)\n```\n\n#### OceanGPT-coder-7B\n```python\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\nimport torch\n\nmodel = AutoModelForCausalLM.from_pretrained(\n    \"zjunlp/OceanGPT-coder-7B\", torch_dtype=torch.float16, device_map=\"auto\"\n)\ntokenizer = AutoTokenizer.from_pretrained(\"zjunlp/OceanGPT-coder-7B\")\nmessages = [\n    {\"role\": \"system\", \"content\": \"You are Qwen, created by Alibaba Cloud. You are a helpful assistant.\"},\n    {\"role\": \"user\", \"content\": \"请为水下机器人生成MOOS代码，实现如下任务：先回到（50,20）点，然后以（15,20）点为圆形，做半径为30的圆周运动，持续时间200s，速度4 m/s。\"}\n]\ntext = tokenizer.apply_chat_template(\n    messages,\n    tokenize=False,\n    add_generation_prompt=True\n)\nmodel_inputs = tokenizer([text], return_tensors=\"pt\").to(model.device)\ngenerated_ids = model.generate(\n    **model_inputs,\n    top_p=0.6,\n    temperature=0.6,\n    max_new_tokens=2048\n)\ngenerated_ids = [\n    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)\n]\nresponse = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]\nprint(response)\n```\n\n#### Inference by vllm\n```python\nfrom transformers import AutoTokenizer\nfrom vllm import LLM, SamplingParams\n\npath = 'YOUR-MODEL-PATH'\n\ntokenizer = AutoTokenizer.from_pretrained(path)\n\nprompt = \"Which is the largest ocean in the world?\"\nmessages = [\n    {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n    {\"role\": \"user\", \"content\": prompt}\n]\ntext = tokenizer.apply_chat_template(\n    messages,\n    tokenize=False,\n    add_generation_prompt=True\n)\n\nsampling_params = SamplingParams(temperature=0.8, top_k=50)\nllm = LLM(model=path)\n\nresponse = llm.generate(text, sampling_params)\n```\n\n## 🤗Chat with Our Demo on Gradio\n\n### Local WebUI Demo\nYou can easily deploy the interactive interface locally using the code we provide.\n\n\u003e 🔧 Before running, modify the model path (OceanGPT/OceanGPT-o/OceanGPT-coder's path) in app.py to your local model path.\n\n```shell\npython app.py\n```\nOpen `https://localhost:7860/` in browser and enjoy the interaction with OceanGPT.\n\n### Online Demo \u003c!-- omit in toc --\u003e\n#### Marine Expertise Q\u0026A\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cimg src=\"figs/3.png\"\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003cimg src=\"figs/4.png\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\nYou can use OceanGPT-basic for marine expertise Q\u0026A.\n\n1. Input your query (optional: upload an Word/PDF).\n2. Choose the generation hyparameters.\n3. Run and get results.\n   \n#### Marine Science Image Interpretation\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cimg src=\"figs/1.png\"\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003cimg src=\"figs/2.png\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\nYou can use OceanGPT-o for marine science image interpretation.\n\n1. Input your query and upload an image.\n2. Choose the generation hyparameters.\n3. Run and get results.\n\n#### Marine Sonar Image Interpretation\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cimg src=\"figs/1.png\"\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003cimg src=\"figs/7.png\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\nYou can use OceanGPT-o for marine sonar image interpretation.\n\n1. Input your query and upload an image.\n2. Choose the generation hyparameters.\n3. Run and get results.\n\n\n\n#### Underwater Robot MOOS Code Generation\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cimg src=\"figs/5.png\"\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003cimg src=\"figs/6.png\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\nYou can use OceanGPT-coder for moos code generation.\n\n1. Input your query.\n2. Choose the generation hyparameters.\n3. Run and get code.\n\n## Fine-tuning OceanGPT for Building Customized QA Applications\n\nThis tutorial is based on the open-source OceanGPT·Cangyuan large model, the EasyDataset open-source tool, and the Llama Factory open-source tool, covering the following key steps:\n\n*   Model Acquisition\n*   EasyDataset Data Engineering\n*   Domain Fine-tuning with Llama Factory\n*   Building a Web Application\n*   User Usage and Effect Validation\n\nThis guide provides a practical engineering solution to help you quickly build a professional Q\u0026A system for the maritime domain. For detailed setup instructions and usage examples, see the [CustomQA_CN.md](https://github.com/zjunlp/OceanGPT/blob/main/CustomQA_CN.md) or [CustomQA_EN.md](https://github.com/zjunlp/OceanGPT/blob/main/CustomQA_EN.md).\n\n## Using MCP Server for Sonar Image Caption\n\nThe [mcp_userver](https://github.com/zjunlp/OceanGPT/tree/main/mcp_server) directory contains the Model Context Protocol (MCP) server for OceanGPT to implement some features.\n\nFor detailed setup instructions and usage examples, see the MCP server [README](https://github.com/zjunlp/OceanGPT/blob/main/mcp_server/README.md).\n\n## 📌Inference\n\n### Efficient Inference with sglang, vLLM, ollama, llama.cpp\n\n\n\u003cdetails\u003e\n\u003csummary\u003e sglang now officially supports Models based Qwen2.5-VL and Qwen2.5. Click to see. \u003c/summary\u003e\n\n1. Install sglang:\n```shell\npip install --upgrade pip\npip install uv\nuv pip install \"sglang[all]\u003e=0.4.6.post4\"\n```\n\n2. Launch Server:\n```python\nimport requests\nfrom openai import OpenAI\nfrom sglang.test.test_utils import is_in_ci\n\nif is_in_ci():\n    from patch import launch_server_cmd\nelse:\n    from sglang.utils import launch_server_cmd\n\nfrom sglang.utils import wait_for_server, print_highlight, terminate_process\n\n\nserver_process, port = launch_server_cmd(\n    \"python3 -m sglang.launch_server --model-path zjunlp/OceanGPT-o-7B --host 0.0.0.0\"\n)\n\nwait_for_server(f\"http://localhost:{port}\")\n```\n\n3. Chat with Model\n```python\nimport requests\n\nurl = f\"http://localhost:{port}/v1/chat/completions\"\n\ndata = {\n    \"model\": \"Qwen/Qwen2.5-VL-7B-Instruct\",\n    \"messages\": [\n        {\n            \"role\": \"user\",\n            \"content\": [\n                {\"type\": \"text\", \"text\": \"What’s in this image?\"},\n                {\n                    \"type\": \"image_url\",\n                    \"image_url\": {\n                        \"url\": \"https://github.com/sgl-project/sglang/blob/main/test/lang/example_image.png?raw=true\"\n                    },\n                },\n            ],\n        }\n    ],\n    \"max_tokens\": 300,\n}\n\nresponse = requests.post(url, json=data)\nprint_highlight(response.text)\n```\n\n\n  \u003c/details\u003e\n\n\n\n\u003cdetails\u003e\n\u003csummary\u003e vLLM now officially supports Models based Qwen2.5-VL and Qwen2.5. Click to see. \u003c/summary\u003e\n\n1. Install vLLM(\u003e=0.7.3):\n```shell\npip install vllm\n```\n\n2. Run Example:\n* [MLLM](https://docs.vllm.ai/en/latest/getting_started/examples/vision_language.html)\n* [LLM](https://docs.vllm.ai/en/latest/getting_started/quickstart.html)\n  \u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eollama now officially supports Models based Qwen2.5. Click to see.\u003c/summary\u003e\n\nCreate a file named `Modelfile`\n```shell\nFROM ./OceanGPT.gguf\nTEMPLATE \"[INST] {{ .Prompt }} [/INST]\"\n```\n\nCreate the model in Ollama:\n```shell\nollama create example -f Modelfile\n```\n\nRunning the model:\n```shell\nollama run example \"What is your favourite condiment?\"\n```\n  \u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ellama.cpp now officially supports Models based Qwen2.5-hf convert to gguf. Click to see.\u003c/summary\u003e\n\nDownload OceanGPT PyTorch model from huggingface to \"OceanGPT\" folder.\n\nClone llama.cpp and make:\n```shell\ngit clone https://github.com/ggml-org/llama.cpp\ncd llama.cpp\nmake llama-cli\n```\n\nAnd then convert PyTorch model to gguf files:\n```shell\npython convert-hf-to-gguf.py OceanGPT --outfile OceanGPT.gguf\n```\n\nRunning the model:\n```shell\n./llama-cli -m OceanGPT.gguf \\\n    -co -cnv -p \"Your prompt\" \\\n    -fa -ngl 80 -n 512\n```\n  \u003c/details\u003e\n\n## 🌻Acknowledgement\n\nOceanGPT (沧渊) 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).\n\nOceanGPT 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).\n\nThanks for their great contributions!\n## Limitations\n\n- The model may have hallucination issues.\n\n- Due to limited computational resources, OceanGPT-o currently only supports natural language generation for certain types of sonar images and ocean science images. OceanGPT-coder currently only supports `MOOS` code generation.\n\n- We did not optimize the identity and the model may generate identity information similar to that of Qwen/MiniCPM/LLaMA/GPT series models.\n\n- The model's output is influenced by prompt tokens, which may result in inconsistent results across multiple attempts.\n\n\n### 🚩Citation\n\nPlease cite the following paper if you use OceanGPT in your work.\n\n```bibtex\n@article{bi2024oceangpt,\n  title={OceanGPT: A Large Language Model for Ocean Science Tasks},\n  author={Bi, Zhen and Zhang, Ningyu and Xue, Yida and Ou, Yixin and Ji, Daxiong and Zheng, Guozhou and Chen, Huajun},\n  journal={arXiv preprint arXiv:2310.02031},\n  year={2024}\n}\n\n```\n\n---\n\n# Contributors\n\n[Ningyu Zhang](https://person.zju.edu.cn/en/ningyu), Yida Xue, Zhen Bi, Xiaozhuan Liang,  Zhisong Qiu, Kewei Xu, Chenxi Wang, Shumin Deng, Xiangyuan Ru, Jintian Zhang, Shuofei Qiao, Guozhou Zheng, Huajun Chen\n\n\nCommunity Contributors: Junjie Zheng, Zhe Ma, Shuwei Peng, Song Gao\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzjunlp%2Foceangpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzjunlp%2Foceangpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzjunlp%2Foceangpt/lists"}