书生·浦语大模型实战-Day02
基于InterLM-Chat-7B的智能对话Demo
Lagent介绍
利用InterLM-Chat-7B写一个300小故事
![image-20240107205152396](https://img-blog.csdnimg.cn/img_convert/0a61c15e4a8688cf27189a9cb6aea12b.png)
下载Hugging Face中的模型文件
首先要安装huggingface-cli
命令行工具
pip install -U huggingface_hub
利用命令行下载
huggingface-cli download --resume-download internlm/internlm-chat-7b --local-dir your_path
- resume-download:断点续下
- local-dir:本地存储路径。(linux 环境下需要填写绝对路径)
利用python文件下载模型部分文件
import os
from huggingface_hub import hf_hub_download # Load model directly
hf_hub_download(repo_id="internlm/internlm-7b", filename="config.json")