书生·浦语第二次课程

轻松玩转书生·浦语大模型趣味Demo

参考:https://github.com/InternLM/tutorial/blob/main/helloworld/hello_world.md#3-lagent-%E6%99%BA%E8%83%BD%E4%BD%93%E5%B7%A5%E5%85%B7%E8%B0%83%E7%94%A8-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 directly 

hf_hub_download(repo_id="internlm/internlm-7b", filename="config.json")

InternLM大模型介绍

大模型:参数量巨大
InternLM:开源轻量级训练框架
Lagent轻量级agent框架
浦语灵笔:视觉语言大模型
LnternLM-Chat-7B
8k长度
Lagent
大语言模型 -> Agent
浦语灵笔
InternLM-XComposer
多模态对话

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值