浦语大模型趣味 Demo
作业:
1.使用 InternLM-Chat-7B 模型生成 300 字的小故事(需截图)
因为命令行版本和web 版本本质没什么区别,所有在web端令InternLM生成小故事:

2.熟悉 hugging face 下载功能,使用 huggingface_hub python 包,下载 InternLM-20B 的 config.json 文件到本地
首先创建huggingface_downloads.py 使用以下代码:
from huggingface_hub import hf_hub_download
model = "internlm/internlm2-chat-20b"
output_dir = "./class2Homework/config.json"
hf_hub_download(repo_id=model, filename="config.json", repo_type="model",cache_dir = output_dir)
hf_hub_download 函数repo_id 是huggingface 仓库名称 filename是要下载的文件,repo_type选择为model cache_dir 为下载本地文件路径
具体参数请查看:https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.hf_hub_download

之后运行文件:

最后在output_dir路径下下载目标config.json文件

进阶:
完成 Lagent 工具调用 Demo 创作部署(需截图)

完成浦语·灵笔的图文理解及创作部署(需截图)

本文介绍了如何使用HuggingFace库下载InternLM-20B模型的配置文件,以及如何通过命令行和工具如Lagent进行故事创作和图文理解的部署过程,包括了实际操作步骤和截图需求。
1686

被折叠的 条评论
为什么被折叠?



