×

签到

分享到微信

打开微信,使用扫一扫进入页面后,点击右上角菜单,

点击“发送给朋友”或“分享到朋友圈”完成分享

【PyTorch 大模型移植】CogView2适配 jyjyjyjyjy2023-08-03 13:56:10 回复 查看 经验交流 社区交流 干货资源
【PyTorch 大模型移植】CogView2适配
分享到:

组件

版本

CogView2

使用torch2mlu脚本转换

d92dbad03020b3d

icetk

使用torch2mlu脚本转换

9f4cd2aa5825

SwissArmyTransformer

使用torch2mlu脚本转换

0.2.12

torch-mlu1.14.0-torch1.9

执行命令

#!/bin/bash                                                                                                                                                                                                  
                                                                                                                                                                                                               
SAT_HOME=./cogview-new python cogview2_text2image.py \                                                                                                                                                       
       --mode inference \                                                                                                                                                                                    
       --fp16 \                                                                                                                                                                                              
       --only-first-stage \                                                                                                                                                                                  
       --input-source input.txt \                                                                                                                                                                            
       --output-path samples_sat_v0.2 \                                                                                                                                                                      
       --batch-size 16 \                                                                                                                                                                                     
       --max-inference-batch-size 8 \                                                                                                                                                                        
       $@

生成图像

a.png

出现问题

解决办法

ImportError: cannot import name 'builder' from 'google.protobuf.internal'pip install protobuf==3.20.0
variable MASTER_ADDR expected, but not set

import os os.environ['MASTER_ADDR'] = 'localhost'

os.environ['MASTER_PORT'] = '5678'

gelu问题image2023-8-1_10-55-35.png


版权所有 © 2024 寒武纪 Cambricon.com 备案/许可证号:京ICP备17003415号-1
关闭