轻松玩转书生·浦语大模型趣味Demo
在做之前需要考虑换源
设置pip默认镜像源,升级 pip 到最新的版本 (>=10.0.0) 后进行配置,如下所示:
python -m pip install --upgrade pip
pip config set global.index-url https://mirrors.cernet.edu.cn/pypi/web/simple
模型下载
使用 Hugging Face 官方提供的 huggingface-cli
命令行工具。安装依赖:
pip install -U huggingface_hub
然后新建 python 文件,填入以下代码,运行即可。
- resume-download:断点续下
- local-dir:本地存储路径。(linux 环境下需要填写绝对路径)
import os
# 下载模型
os.system('huggingface-cli download --resume-download internlm/internlm-chat-7b --local-dir your_path')
以下内容将展示使用 huggingface_hub
下载模型中的部分文件
import os
from huggingface_hub import hf_hub_download # Load model directlyhf_hub_download(repo_id="internlm/internlm-7b", filename="config.json")
InternLM大模型介绍
大模型:参数量巨大
InternLM:开源轻量级训练框架
Lagent轻量级agent框架
浦语灵笔:视觉语言大模型
LnternLM-Chat-7B
8k长度
Lagent
大语言模型 -> Agent
浦语灵笔
InternLM-XComposer
多模态对话