轻量高效,8B 性能强劲书生科学多模态模型Intern-S1-mini开源

简介: 继 7 月 26 日开源『书生』科学多模态大模型 Intern-S1 之后,上海人工智能实验室(上海AI实验室)在8月23日推出了轻量化版本 Intern-S1-mini。

继 7 月 26 日开源『书生』科学多模态大模型 Intern-S1 之后,上海人工智能实验室(上海AI实验室)在8月23日推出了轻量化版本 Intern-S1-mini。

凭借领先的通用与专业科学能力,Intern-S1 上线后连续多日霸榜 HuggingFace 多模态 Trending 全球第一,并在开源社区引发了广泛关注。作为 8B 参数的“迷你模型”,Intern-S1-mini 同样兼具通用能力与专业科学能力,且更加适合快速部署和二次开发。Intern-S1-mini 性能速览:

  • 通用能力稳居同量级第一梯队:在 MMLU-Pro、AIME2025、MMMU 等多项权威基准上表现卓越,展现出兼具稳定性与竞争力的综合实力;
  • 科学专业能力优异:在化学、材料等任务表现尤为突出,在 SmolInstruct、ChemBench、MatBench 等基准测试中显著领先;在物理、地球、生物等学科任务中也保持第一梯队水平,体现出扎实的科学理解与跨领域泛化能力;
  • 减身材不减实力,助力科研、开发、教育多种场景。

 

image.gif 编辑

Intern-S1-mini 体验页面:

https://chat.intern-ai.org.cn

GitHub:

https://github.com/InternLM/Intern-S1

模型:

https://modelscope.cn/models/Shanghai_AI_Laboratory/Intern-S1-mini

01.模型亮点

在多技能学习过程中,模型常面临数据冲突,导致能力之间此消彼长。尤其是轻量模型,这种冲突更为明显。

Intern-S1-mini 延续大模型 Intern-S1 的设计理念,覆盖文本、图像、分子式、蛋白质等多模态、多任务数据领域。多模态与多任务的叠加,再加上轻量化的模型尺寸,对能力融合算法提出了极高要求。

研究团队充分发挥通专融合路线的技术优势,使 Intern-S1-mini 在各种能力之间实现了极致的平衡,能够同时兼顾文本、图文与科学能力,实现轻量模型也能拥有 大模型 的综合实力。

Intern-S1-mini 在多项通用评测基准(如 MMLU-Pro、AIME2025、MMMU)中表现出色,通用能力稳居第一梯队;在科学任务中同样卓越,尤其在化学、材料等领域表现突出,在 SmolInstruct、ChemBench、MatBench 等基准中显著领先;在物理、地球、生物等学科任务中也保持领先水平,展现强劲的专业学科实力。

02.模型推理&部署

模型推理

官方推荐使用以下超参数以确保更好的结果

top_p = 1.0
top_k = 50
min_p = 0.0
temperature = 0.8

image.gif

Transformers

提供以下示例代码,说明如何基于文本和多模态输入生成内容

请使用 transformers>=4.55.2 以确保模型正常工作

  • 文本输入
from modelscope import AutoProcessor, AutoModelForCausalLM,snapshot_download
import torch
model_name = snapshot_download("Shanghai_AI_Laboratory/Intern-S1-mini")
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype="auto", trust_remote_code=True)
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "http://images.cocodataset.org/val2017/000000039769.jpg"},
            {"type": "text", "text": "Please describe the image explicitly."},
        ],
    }
]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt").to(model.device, dtype=torch.bfloat16)
generate_ids = model.generate(**inputs, max_new_tokens=32768)
decoded_output = processor.decode(generate_ids[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True)
print(decoded_output)

image.gif

  • 图像输入
from modelscope import AutoProcessor, AutoModelForCausalLM
import torch
model_name = "Shanghai_AI_Laboratory/Intern-S1-mini"
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype="auto", trust_remote_code=True)
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "http://images.cocodataset.org/val2017/000000039769.jpg"},
            {"type": "text", "text": "Please describe the image explicitly."},
        ],
    }
]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt").to(model.device, dtype=torch.bfloat16)
generate_ids = model.generate(**inputs, max_new_tokens=32768)
decoded_output = processor.decode(generate_ids[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True)
print(decoded_output)

image.gif

  • 视频输入

需通过 pip install decord 安装 decord 视频解码库。为了避免 OOM,请安装 flash_attention 并使用至少 2 块 GPU。

from modelscope import AutoProcessor, AutoModelForCausalLM
import torch
model_name = "Shanghai_AI_Laboratory/Intern-S1-mini"
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype="auto", trust_remote_code=True)
messages = [
        {
            "role": "user",
            "content": [
                {
                    "type": "video",
                    "url": "https://huggingface.co/datasets/hf-internal-testing/fixtures_videos/resolve/main/tennis.mp4",
                },
                {"type": "text", "text": "What type of shot is the man performing?"},
            ],
        }
    ]
inputs = processor.apply_chat_template(
        messages,
        return_tensors="pt",
        add_generation_prompt=True,
        video_load_backend="decord",
        tokenize=True,
        return_dict=True,
    ).to(model.device, dtype=torch.float16)
generate_ids = model.generate(**inputs, max_new_tokens=32768)
decoded_output = processor.decode(generate_ids[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True)
print(decoded_output)

image.gif

 

服务部署

部署 Intern-S1 系列模型的最低硬件要求是:

模型

A100

(GPUs)

H800

(GPUs)

H100

(GPUs)

H200

(GPUs)

Intern-S1-mini

1

1

1

1

Intern-S1-mini-FP8

-

1

1

1

可以使用以下 任意LLM 推理框架之一来创建一个与 OpenAI 兼容的服务器:

下载模型

modelscope download Shanghai_AI_Laboratory/Intern-S1-mini --local_dir ./Intern-S1-mini

image.gif

lmdeploy(>=0.9.2)

lmdeploy serve api_server ./Intern-S1-mini --reasoning-parser intern-s1 --tool-call-parser intern-s1

image.gif

vllm

vllm serve ./Intern-S1-mini --trust-remote-code

image.gif

sglang

python3 -m sglang.launch_server \
    --model-path ./Intern-S1-mini \
    --trust-remote-code \
    --grammar-backend none

image.gif

ollama 用于本地部署

# install ollama
curl -fsSL https://ollama.com/install.sh | sh
# fetch model
ollama pull internlm/interns1-mini
# run model
ollama run internlm/interns1-mini
# then use openai client to call on http://localhost:11434/v1

image.gif

03.模型微调

ms-swift已经支持对Intern-S1系列模型进行训练。ms-swift是魔搭社区官方提供的大模型与多模态大模型训练部署框架。

ms-swift开源地址:

https://github.com/modelscope/ms-swift

下面以Intern-S1-mini模型为例,展示可运行的微调demo,并给出自定义数据集的格式。

在开始微调之前,请确保您的环境已准备妥当。

# pip install git+https://github.com/modelscope/ms-swift.git
git clone https://github.com/modelscope/ms-swift.git
cd ms-swift
pip install -e .
pip install git+https://github.com/huggingface/transformers.git

image.gif

如果您需要自定义数据集微调模型,你可以将数据准备成以下格式。

{"messages": [{"role": "user", "content": "<image><image>What is the difference between the two images?"}, {"role": "assistant", "content": "The first one is a kitten, and the second one is a puppy."}], "images": ["/xxx/x.jpg", "/xxx/x.png"]}

image.gif

训练脚本:

# 36G
CUDA_VISIBLE_DEVICES=0 \
swift sft \
    --model Shanghai_AI_Laboratory/Intern-S1-mini \
    --dataset 'AI-ModelScope/LaTeX_OCR:human_handwrite#20000' \
    --split_dataset_ratio 0.01 \
    --train_type lora \
    --torch_dtype bfloat16 \
    --num_train_epochs 1 \
    --per_device_train_batch_size 1 \
    --per_device_eval_batch_size 1 \
    --learning_rate 1e-4 \
    --lora_rank 8 \
    --lora_alpha 32 \
    --target_modules all-linear \
    --freeze_vit true \
    --gradient_accumulation_steps 16 \
    --eval_steps 50 \
    --save_steps 50 \
    --save_total_limit 2 \
    --logging_steps 5 \
    --max_length 2048 \
    --output_dir output \
    --warmup_ratio 0.05 \
    --dataloader_num_workers 4

image.gif

显存占用:

 

image.gif 编辑

 

训练完成后,使用以下命令进行推理:

CUDA_VISIBLE_DEVICES=0 \
swift infer \
    --adapters output/vx-xxx/checkpoint-xxx \
    --stream true \
    --load_data_args true \
    --max_new_tokens 2048

image.gif

推送模型到ModelScope:

swift export \
    --adapters output/vx-xxx/checkpoint-xxx \
    --push_to_hub true \
    --hub_model_id '<your-model-id>' \
    --hub_token '<your-sdk-token>'

image.gif

点击链接,即可跳转模型链接~

https://modelscope.cn/models/Shanghai_AI_Laboratory/Intern-S1-mini

目录
相关文章
|
5月前
|
人工智能 自然语言处理 IDE
模型微调不再被代码难住!PAI和Qwen3-Coder加速AI开发新体验
通义千问 AI 编程大模型 Qwen3-Coder 正式开源,阿里云人工智能平台 PAI 支持云上一键部署 Qwen3-Coder 模型,并可在交互式建模环境中使用 Qwen3-Coder 模型。
1055 109
|
5月前
|
分布式计算 测试技术 Spark
科大讯飞开源星火化学大模型、文生音效模型
近期,科大讯飞在魔搭社区(ModelScope)和Gitcode上开源两款模型:讯飞星火化学大模型Spark Chemistry-X1-13B、讯飞文生音频模型AudioFly,助力前沿化学技术研究,以及声音生成技术和应用的探索。
539 2
|
5月前
|
机器学习/深度学习 数据采集 人工智能
通义实验室Mobile-Agent-v3开源,全平台SOTA的GUI智能体,支持手机电脑等多平台交互
近日,通义实验室MobileAgent团队正式开源全新图形界面交互基础模型 GUI-Owl,并同步推出支持多智能体协同的自动化框架 Mobile-Agent-v3。该模型基于Qwen2.5-VL打造,在手机端与电脑端共8个GUI任务榜单中全面刷新开源模型性能纪录,达成全平台SOTA。
1826 2
|
4月前
|
人工智能 搜索推荐 程序员
当AI学会“跨界思考”:多模态模型如何重塑人工智能
当AI学会“跨界思考”:多模态模型如何重塑人工智能
574 120
|
5月前
|
人工智能 Java 开发者
阿里出手!Java 开发者狂喜!开源 AI Agent 框架 JManus 来了,初次见面就心动~
JManus是阿里开源的Java版OpenManus,基于Spring AI Alibaba框架,助力Java开发者便捷应用AI技术。支持多Agent框架、网页配置、MCP协议及PLAN-ACT模式,可集成多模型,适配阿里云百炼平台与本地ollama。提供Docker与源码部署方式,具备无限上下文处理能力,适用于复杂AI场景。当前仍在完善模型配置等功能,欢迎参与开源共建。
2401 58
阿里出手!Java 开发者狂喜!开源 AI Agent 框架 JManus 来了,初次见面就心动~
|
5月前
|
机器学习/深度学习 人工智能 自然语言处理
AI Compass前沿速览:Qwen3-Max、Mixboard、Qwen3-VL、Audio2Face、Vidu Q2 AI视频生成模型、Qwen3-LiveTranslate-全模态同传大模型
AI Compass前沿速览:Qwen3-Max、Mixboard、Qwen3-VL、Audio2Face、Vidu Q2 AI视频生成模型、Qwen3-LiveTranslate-全模态同传大模型
882 13
AI Compass前沿速览:Qwen3-Max、Mixboard、Qwen3-VL、Audio2Face、Vidu Q2 AI视频生成模型、Qwen3-LiveTranslate-全模态同传大模型

热门文章

最新文章