趣味 Demo 任务
- 本地部署 InternLM2-Chat-1.8B 模型进行智能对话
作业
基础作业:使用 InternLM2-Chat-1.8B 模型生成一个 300 字的小故事
进阶作业
使用 huggingface_hub包,下载 InternLM-Chat-7B 的 config.json 文件到本地
import os
from huggingface_hub import hf_hub_download # Load model directly
hf_hub_download(repo_id="internlm/internlm2-7b", filename="config.json")
配置环境
使用conda创建python虚拟环境并安装依赖包
conda create -n demo python==3.10 -y
conda activate demo
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia
pip install huggi