"vscode:/vscode.git/clone" did not exist on "d5679ea6f6600ab89cacb2c7f8efa2d7b4f933ff"
Commit 8c9deefb authored by suily's avatar suily
Browse files

修改README

parent 0c783858
...@@ -24,6 +24,40 @@ Vicuna:即LLM,用<video>来代表视频内容,将视觉特征Z嵌入到tex ...@@ -24,6 +24,40 @@ Vicuna:即LLM,用<video>来代表视频内容,将视觉特征Z嵌入到tex
<img src="./doc/VTimeLLM.PNG"/> <img src="./doc/VTimeLLM.PNG"/>
</div> </div>
## 代码改动说明
deepspeed0.14.2只能使用transformers4.31.0,此版本不支持k100ai使用bf16/tf32精度,修改transformers代码,避免精度错误:
ps:仓库中是改动后的代码,不需再次修改
```
pip show pip #查看依赖库安装地址site-packages
1、site-packages/transformers/utils/import_utils.py,修改def is_torch_bf16_gpu_available():
...
#TODO:if torch.cuda.is_available() and torch.version.cuda is not None:
if torch.cuda.is_available():
if torch.cuda.get_device_properties(torch.cuda.current_device()).major < 8:
return False
# if int(torch.version.cuda.split(".")[0]) < 11:
# return False
if not hasattr(torch.cuda.amp, "autocast"):
return False
else:
return False
2、site-packages/transformers/utils/import_utils.py,修改def is_torch_tf32_available():
...
#TODO:if not torch.cuda.is_available() or torch.version.cuda is None:
if not torch.cuda.is_available():
return False
if torch.cuda.get_device_properties(torch.cuda.current_device()).major < 8:
return False
# if int(torch.version.cuda.split(".")[0]) < 11:
# return False
if version.parse(version.parse(torch.__version__).base_version) < version.parse("1.7"):
return False
return True
```
## 环境配置 ## 环境配置
### Docker(方法一) ### Docker(方法一)
``` ```
...@@ -89,10 +123,13 @@ ps:本仓库准备了小数据集供训练测试,数据量约为完整数据 ...@@ -89,10 +123,13 @@ ps:本仓库准备了小数据集供训练测试,数据量约为完整数据
* [stage1.json](https://huggingface.co/datasets/liuhaotian/LLaVA-Pretrain/blob/main/blip_laion_cc_sbu_558k.json) * [stage1.json](https://huggingface.co/datasets/liuhaotian/LLaVA-Pretrain/blob/main/blip_laion_cc_sbu_558k.json)
* [stage2.json](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/files/?p=%2Fdata%2Fstage2.json) * [stage2.json](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/files/?p=%2Fdata%2Fstage2.json)
* [stage3.json](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/files/?p=%2Fdata%2Fstage3.json) * [stage3.json](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/files/?p=%2Fdata%2Fstage3.json)
(2)ChatGLM3-6b: (2)ChatGLM3-6b:
* [stage1/2/3.json](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/files/?p=%2Fdata%2Fdata_Chinese.zip) * [stage1/2/3.json](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/files/?p=%2Fdata%2Fdata_Chinese.zip)
2、下载feat 2、下载feat
* [feat_list](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/?p=%2Ffeat&mode=list) * [feat_list](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/?p=%2Ffeat&mode=list)
解压缩feat的代码如下: 解压缩feat的代码如下:
``` ```
cd VTimeLLM/feat cd VTimeLLM/feat
...@@ -123,6 +160,7 @@ VTimeLLM可基于Vicuna v1.5训练英文版本、基于ChatGLM3-6b训练中文 ...@@ -123,6 +160,7 @@ VTimeLLM可基于Vicuna v1.5训练英文版本、基于ChatGLM3-6b训练中文
1、下载cilp模型 1、下载cilp模型
* [scnet](http://113.200.138.88:18080/aimodels/findsource-dependency/vtimellm) * [scnet](http://113.200.138.88:18080/aimodels/findsource-dependency/vtimellm)
* [官网链接](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/?p=%2Fcheckpoints&mode=list) * [官网链接](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/?p=%2Fcheckpoints&mode=list)
2-1、下载Vicuna v1.5权重 2-1、下载Vicuna v1.5权重
* [scnet](http://113.200.138.88:18080/aimodels/vicuna-7b-v1.5) * [scnet](http://113.200.138.88:18080/aimodels/vicuna-7b-v1.5)
* [官网链接](https://huggingface.co/lmsys/vicuna-7b-v1.5/tree/main) * [官网链接](https://huggingface.co/lmsys/vicuna-7b-v1.5/tree/main)
...@@ -163,15 +201,14 @@ sh scripts/stage3.sh ...@@ -163,15 +201,14 @@ sh scripts/stage3.sh
## 推理 ## 推理
VTimeLLM基于Vicuna v1.5训练了英文版本,存储为vtimellm-vicuna-v1-5-7b.tar.gz;基于ChatGLM3-6b训练了中文版本,存储为vtimellm-chatglm3-6b.tar.gz。推理某个版本时只下载对应的模型即可。 VTimeLLM基于Vicuna v1.5训练了英文版本,存储为vtimellm-vicuna-v1-5-7b.tar.gz;基于ChatGLM3-6b训练了中文版本,存储为vtimellm-chatglm3-6b.tar.gz。推理某个版本时只下载对应的模型即可。
推理需要分别下载clip、Vicuna v1.5(或ChatGLM3-6b)、VTimeLLM权重,并将它们放入 'checkpoints' 目录中。clip、Vicuna v1.5(或ChatGLM3-6b)的下载参考训练阶段,VTimeLLM权重的下载链接如下: 推理需要分别下载clip、Vicuna v1.5(或ChatGLM3-6b)、VTimeLLM权重,并将它们放入 'checkpoints' 目录中。clip、Vicuna v1.5(或ChatGLM3-6b)的下载参考训练阶段,VTimeLLM权重的下载链接如下:
* [scnet](http://113.200.138.88:18080/aimodels/findsource-dependency/vtimellm) * [scnet](http://113.200.138.88:18080/aimodels/findsource-dependency/vtimellm)
* [官网链接](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/?p=%2Fcheckpoints&mode=list) * [官网链接](https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/?p=%2Fcheckpoints&mode=list)
解压VTimeLLM权重的代码如下: 解压VTimeLLM权重的代码如下:
''' '''
cd VTimeLLM/checkpoints cd VTimeLLM/checkpoints
tar -xzvf vtimellm-vicuna-v1-5-7b.tar.gz tar -xzvf vtimellm-vicuna-v1-5-7b.tar.gz
# 或 #tar -xzvf vtimellm-chatglm3-6b.tar.gz
tar -xzvf vtimellm-chatglm3-6b.tar.gz
''' '''
以基于Vicuna v1.5的VTimeLLM为例,模型目录结构如下: 以基于Vicuna v1.5的VTimeLLM为例,模型目录结构如下:
``` ```
...@@ -219,9 +256,12 @@ HIP_VISIBLE_DEVICES=0 python -m vtimellm.inference \ ...@@ -219,9 +256,12 @@ HIP_VISIBLE_DEVICES=0 python -m vtimellm.inference \
`家具,电商,医疗,广媒,教育` `家具,电商,医疗,广媒,教育`
## 预训练权重 ## 预训练权重
- http://113.200.138.88:18080/aimodels/findsource-dependency/vtimellm (vtimellm、clip) - http://113.200.138.88:18080/aimodels/findsource-dependency/vtimellm (vtimellm、clip)
- http://113.200.138.88:18080/aimodels/vicuna-7b-v1.5.git (vicuna-7b-v1.5) http://113.200.138.88:18080/aimodels/vicuna-7b-v1.5.git (vicuna-7b-v1.5)
- http://113.200.138.88:18080/aimodels/chatglm3-6b (chatglm3-6b) http://113.200.138.88:18080/aimodels/chatglm3-6b (chatglm3-6b)
- https://cloud.tsinghua.edu.cn/d/6db5d02883124826aa6f/?p=%2Fcheckpoints&mode=list (vtimellm、clip)
https://huggingface.co/lmsys/vicuna-7b-v1.5 (vicuna-7b-v1.5)
https://huggingface.co/THUDM/chatglm3-6b/tree/main (chatglm3-6b)
## 源码仓库及问题反馈 ## 源码仓库及问题反馈
- https://developer.sourcefind.cn/codes/suily/vtimellm_pytorch - https://developer.sourcefind.cn/codes/suily/vtimellm_pytorch
## 参考资料 ## 参考资料
- https://github.com/huangb23/VTimeLLM - https://github.com/huangb23/VTimeLLM
\ No newline at end of file
# 模型唯一标识
modelCode = 1107
# 模型名称
modelName=vtimellm_pytorch
# 模型描述
modelDescription=VTimeLLM是一种新颖的Video LLM,旨在对时间边界进行细粒度的视频时刻理解和推理。
# 应用场景
appScenario=推理,训练,视频理解,气象,交通,电商,广媒,教育
# 框架类型
frameType=pytorch
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment