第二讲

大模型及InternLM介绍

什么是大模型?

人工智能领域中参数数量巨大,拥有庞大计算能力和参数规模的模型。

特点:

  1. 大量数据进行训练
  2. 数十亿甚至千亿参数
  3. 在各种任务重展现出惊人的性能

SSH连接开发机

  1. 本地机器上打开终端
  2. 生成SSH密钥对
ssh-keygen
  1. 在InternStudio配置公钥:cat命令查看公钥并将其复制到InternStudio上

两个demo

依照课后文档做即可
https://github.com/InternLM/tutorial/blob/main/helloworld/hello_world.md#6-课后作业

web demo演示

这里只以InternLM演示,Lagent工具demo与之类似。

命令行运行

image.png

网页运行
cd /root/code/InternLM
streamlit run web_demo.py --server.address 127.0.0.1 --server.port 6006

课后作业

基础

使用 InternLM-Chat-7B 模型生成 300 字的小故事(需截图)

image.png

熟悉 hugging face 下载功能,使用 huggingface_hub python 包,下载 InternLM-20B 的 config.json 文件到本地(需截图下载过程)。
  1. 导入环境变量
export HF_ENDPOINT=https://hf-mirror.com
  1. 新建python文件代码如下
import os
from huggingface_hub import hf_hub_download  # Load model directly 

hf_hub_download(repo_id="internlm/internlm-20b", filename="config.json", local_dir='.')
  1. 运行即可
    image.png
完成 Lagent 工具调用 Demo 创作部署(需截图)

可以看出对于复杂的问题有思路但是可能由于模型自身限制导致回答不全
image.png
image.png

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

image.png

image.png

总结

轻量模型在准确性上还是不可靠,需要有自己判断(从以下问题就可以看出),但是整体日常工作的问题还是可以有着很强的泛化能力。

image.png
image.png

posted @ 2024-01-13 23:14  viewoverlook  阅读(11)  评论(0编辑  收藏  举报