大模型实战营第二次课作业

这是大模型实战营第二次课的作业

基础作业

使用 InternLM-Chat-7B 模型生成 300 字的小故事

Machines help machines (笑)

使用 huggingface_hub python 包,下载 InternLM-20B 的 config.json 文件到本地

代码

1
2
from huggingface_hub import hf_hub_download 
hf_hub_download(repo_id="internlm/internlm-20b", filename="config.json")

下载过程

文件内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"architectures": [
"InternLMForCausalLM"
],
"auto_map": {
"AutoConfig": "configuration_internlm.InternLMConfig",
"AutoModel": "modeling_internlm.InternLMForCausalLM",
"AutoModelForCausalLM": "modeling_internlm.InternLMForCausalLM"
},
"bias": false,
"bos_token_id": 1,
"eos_token_id": 2,
"hidden_act": "silu",
"hidden_size": 5120,
"initializer_range": 0.02,
"intermediate_size": 13824,
"max_position_embeddings": 4096,
"model_type": "internlm",
"num_attention_heads": 40,
"num_hidden_layers": 60,
"num_key_value_heads": 40,
"pad_token_id": 2,
"pretraining_tp": 1,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 10000.0,
"tie_word_embeddings": false,
"torch_dtype": "bfloat16",
"transformers_version": "4.33.1",
"use_cache": true,
"vocab_size": 103168,
"rotary": {
"base": 10000,
"type": "dynamic"
}
}

进阶作业

浦语·灵笔的图文理解及创作部署

  1. 创作图文并茂文章

  1. 多模态对话

这个Open Assistan什么鬼(笑)

Lagent 工具调用 Demo 创作部署