[{"data":1,"prerenderedAt":887},["ShallowReactive",2],{"content-query-oq2F69AmUn":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"body":13,"_type":881,"_id":882,"_source":883,"_file":884,"_stem":885,"_extension":886},"/news/zh/3610","zh",false,"","人人都能上手部署DeepSeek模型：Janus-Pro香橙派开发板实践指南","2025 年春节，AI 领域再掀波澜！DeepSeek的Janus-Pro模型横空出世，以创新的双路径架构以及强大的多模态交互能力，引发业界广泛关注。","2025-02-14","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/4512892ed7664d98ba622c1c8a00acba.png","news",{"type":14,"children":15,"toc":842},"root",[16,24,34,39,44,49,60,69,77,85,93,98,106,114,123,133,138,149,154,161,166,173,182,194,201,206,215,224,237,247,254,261,270,278,285,293,296,304,312,321,326,331,344,348,355,360,365,374,378,383,390,397,407,412,419,424,432,437,445,450,455,463,467,472,480,485,492,497,502,510,515,522,527,535,539,547,555,564,569,577,586,599,606,611,620,625,633,638,645,661,666,671,679,687,691,705,710,718,723,728,735,749,757,766,771,779,789,796,801,808,817,822,830,835],{"type":17,"tag":18,"props":19,"children":21},"element","h1",{"id":20},"人人都能上手部署deepseek模型janus-pro香橙派开发板实践指南",[22],{"type":23,"value":8},"text",{"type":17,"tag":25,"props":26,"children":28},"h3",{"id":27},"前序",[29],{"type":17,"tag":30,"props":31,"children":32},"strong",{},[33],{"type":23,"value":27},{"type":17,"tag":35,"props":36,"children":37},"p",{},[38],{"type":23,"value":9},{"type":17,"tag":35,"props":40,"children":41},{},[42],{"type":23,"value":43},"为了让更多开发者能够快速上手，我们基于MindSpore AI框架和MindSpore NLP套件在香橙派AI pro（20T）24G开发板上，部署了DeepSeek-Janus-Pro 模型，希望通过我们的努力，能够为 AI 社区的发展贡献一份力量，让更多人能够参与到 AI 的浪潮中来，以下是详细的DeepSeek-Janus-Pro部署教程。",{"type":17,"tag":35,"props":45,"children":46},{},[47],{"type":23,"value":48},"开源链接：",{"type":17,"tag":35,"props":50,"children":51},{},[52],{"type":17,"tag":53,"props":54,"children":58},"a",{"href":55,"rel":56},"https://gitee.com/mindspore-lab/mindnlp.git",[57],"nofollow",[59],{"type":23,"value":55},{"type":17,"tag":35,"props":61,"children":62},{},[63],{"type":17,"tag":53,"props":64,"children":67},{"href":65,"rel":66},"https://github.com/mindspore-lab/mindnlp.git",[57],[68],{"type":23,"value":65},{"type":17,"tag":25,"props":70,"children":72},{"id":71},"前期准备",[73],{"type":17,"tag":30,"props":74,"children":75},{},[76],{"type":23,"value":71},{"type":17,"tag":35,"props":78,"children":79},{},[80],{"type":17,"tag":30,"props":81,"children":82},{},[83],{"type":23,"value":84},"硬件、软件环境要求",{"type":17,"tag":35,"props":86,"children":87},{},[88],{"type":17,"tag":30,"props":89,"children":90},{},[91],{"type":23,"value":92},"硬件：",{"type":17,"tag":35,"props":94,"children":95},{},[96],{"type":23,"value":97},"Orange Pi AIpro(20T)开发板一个、鼠标、键盘、显示屏、网线、电源线。",{"type":17,"tag":35,"props":99,"children":100},{},[101],{"type":17,"tag":30,"props":102,"children":103},{},[104],{"type":23,"value":105},"软件环境",{"type":17,"tag":35,"props":107,"children":108},{},[109],{"type":17,"tag":110,"props":111,"children":113},"img",{"alt":7,"src":112},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/fded830104214c079ba6837adccfa847.png",[],{"type":17,"tag":25,"props":115,"children":117},{"id":116},"步骤一烧录镜像",[118],{"type":17,"tag":30,"props":119,"children":120},{},[121],{"type":23,"value":122},"步骤一：烧录镜像",{"type":17,"tag":124,"props":125,"children":127},"h4",{"id":126},"_1下载镜像",[128],{"type":17,"tag":30,"props":129,"children":130},{},[131],{"type":23,"value":132},"1、下载镜像",{"type":17,"tag":35,"props":134,"children":135},{},[136],{"type":23,"value":137},"注意，不同型号的香橙派开发板使用的镜像不同，因此需要专门针对Orange Pi AIpro(20T)烧录镜像。",{"type":17,"tag":35,"props":139,"children":140},{},[141,143],{"type":23,"value":142},"首先，从官网获取20T开发版镜像，镜像地址：",{"type":17,"tag":53,"props":144,"children":147},{"href":145,"rel":146},"http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-AIpro%2820T%29.html",[57],[148],{"type":23,"value":145},{"type":17,"tag":35,"props":150,"children":151},{},[152],{"type":23,"value":153},"进入后可以看到有Ubuntu和openEuler两个镜像环境，本次教程用Ubuntu镜像作为示例：",{"type":17,"tag":35,"props":155,"children":156},{},[157],{"type":17,"tag":110,"props":158,"children":160},{"alt":7,"src":159},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/1da2decd3cce476b918d2eca024b8b0c.png",[],{"type":17,"tag":35,"props":162,"children":163},{},[164],{"type":23,"value":165},"点击“下载”，进入百度网盘，依次选择“Ubuntu\"、\"opiaipro_20t_ubuntu22.04_desktop_aarch64_20240924.img.xz\"，进行下载。",{"type":17,"tag":35,"props":167,"children":168},{},[169],{"type":17,"tag":110,"props":170,"children":172},{"alt":7,"src":171},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/f15b23ba94d448f8bc0df487c7a909f2.png",[],{"type":17,"tag":124,"props":174,"children":176},{"id":175},"_2烧录镜像",[177],{"type":17,"tag":30,"props":178,"children":179},{},[180],{"type":23,"value":181},"2、烧录镜像",{"type":17,"tag":35,"props":183,"children":184},{},[185,187,192],{"type":23,"value":186},"然后准备一张至少64G大小的SD卡，将SD卡插入读卡器中，打开镜像烧录软件balenaEtcher（请使用1.18版本，",{"type":17,"tag":30,"props":188,"children":189},{},[190],{"type":23,"value":191},"并使用管理员身份运行",{"type":23,"value":193},"）如图所示。",{"type":17,"tag":35,"props":195,"children":196},{},[197],{"type":17,"tag":110,"props":198,"children":200},{"alt":7,"src":199},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/4475b417fbf945a88b0df7a256440a8d.png",[],{"type":17,"tag":35,"props":202,"children":203},{},[204],{"type":23,"value":205},"选择好镜像文件和SD卡之后，就可以开始烧录了，烧录之后会显示烧录成功。",{"type":17,"tag":25,"props":207,"children":209},{"id":208},"步骤二开发板启动与连接",[210],{"type":17,"tag":30,"props":211,"children":212},{},[213],{"type":23,"value":214},"步骤二：开发板启动与连接",{"type":17,"tag":124,"props":216,"children":218},{"id":217},"_1开发板连接",[219],{"type":17,"tag":30,"props":220,"children":221},{},[222],{"type":23,"value":223},"1、开发板连接",{"type":17,"tag":35,"props":225,"children":226},{},[227,229,235],{"type":23,"value":228},"我们将烧录好的SD卡插入到香橙派卡槽当中，并启动开发板（开发板事先要连接显示屏、键盘和鼠标。开发板连接可以参考官方资料中的“用户手册”",{"type":17,"tag":53,"props":230,"children":233},{"href":231,"rel":232},"http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-AIpro(20T).html",[57],[234],{"type":23,"value":231},{"type":23,"value":236},"）。",{"type":17,"tag":35,"props":238,"children":239},{},[240,242],{"type":23,"value":241},"开发板启动后，开发板支持多种连接方式，如串口连接、网线连接等，请参考用户手册的2.9、3.5、3.6节，如下图所示，",{"type":17,"tag":30,"props":243,"children":244},{},[245],{"type":23,"value":246},"选择其中的一种方式连接开发板。",{"type":17,"tag":35,"props":248,"children":249},{},[250],{"type":17,"tag":110,"props":251,"children":253},{"alt":7,"src":252},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/ba0d99d8461b45339f3f6626f8235b0f.png",[],{"type":17,"tag":35,"props":255,"children":256},{},[257],{"type":17,"tag":110,"props":258,"children":260},{"alt":7,"src":259},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/6b2245ad1dc9419395c59947f7dff73e.png",[],{"type":17,"tag":124,"props":262,"children":264},{"id":263},"_2设置swap",[265],{"type":17,"tag":30,"props":266,"children":267},{},[268],{"type":23,"value":269},"2、设置swap",{"type":17,"tag":35,"props":271,"children":272},{},[273],{"type":17,"tag":30,"props":274,"children":275},{},[276],{"type":23,"value":277},"登录开发板后请参考3.18节设置swap内存为24G。",{"type":17,"tag":35,"props":279,"children":280},{},[281],{"type":17,"tag":110,"props":282,"children":284},{"alt":7,"src":283},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/5527cb1f90df4b698cb0d345c685a346.png",[],{"type":17,"tag":25,"props":286,"children":288},{"id":287},"环境配置",[289],{"type":17,"tag":30,"props":290,"children":291},{},[292],{"type":23,"value":287},{"type":17,"tag":124,"props":294,"children":295},{"id":7},[],{"type":17,"tag":35,"props":297,"children":298},{},[299],{"type":17,"tag":30,"props":300,"children":301},{},[302],{"type":23,"value":303},"01",{"type":17,"tag":35,"props":305,"children":306},{},[307],{"type":17,"tag":30,"props":308,"children":309},{},[310],{"type":23,"value":311},"CANN升级",{"type":17,"tag":124,"props":313,"children":315},{"id":314},"_1cann包下载",[316],{"type":17,"tag":30,"props":317,"children":318},{},[319],{"type":23,"value":320},"1、CANN包下载",{"type":17,"tag":322,"props":323,"children":325},"h2",{"id":324},"_1",[],{"type":17,"tag":35,"props":327,"children":328},{},[329],{"type":23,"value":330},"镜像中预装的是CANN 7.0，需要对CANN版本进行升级。",{"type":17,"tag":35,"props":332,"children":333},{},[334,336,342],{"type":23,"value":335},"在开发板系统中，进入官网(",{"type":17,"tag":53,"props":337,"children":340},{"href":338,"rel":339},"https://www.hiascend.com/developer/download/community/result?module=cann&cann=8.0.RC3.alpha002",[57],[341],{"type":23,"value":338},{"type":23,"value":343},")，按照下图中的标注进行筛选。",{"type":17,"tag":322,"props":345,"children":347},{"id":346},"_2",[],{"type":17,"tag":35,"props":349,"children":350},{},[351],{"type":17,"tag":110,"props":352,"children":354},{"alt":7,"src":353},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/eafc25f0550845c1817061278c911c85.png",[],{"type":17,"tag":35,"props":356,"children":357},{},[358],{"type":23,"value":359},"分别下载：",{"type":17,"tag":35,"props":361,"children":362},{},[363],{"type":23,"value":364},"Ascend-cann-toolkit_8.0.RC3.alpha002_linux-aarch64.run和Ascend-cann-kernels-310b_8.0.RC3.alpha002_linux.run。",{"type":17,"tag":124,"props":366,"children":368},{"id":367},"_2cann包安装",[369],{"type":17,"tag":30,"props":370,"children":371},{},[372],{"type":23,"value":373},"2、CANN包安装",{"type":17,"tag":322,"props":375,"children":377},{"id":376},"_3",[],{"type":17,"tag":35,"props":379,"children":380},{},[381],{"type":23,"value":382},"下载完成后进入下载目录，如果你是使用浏览器下载，默认在~/Downloads目录下，在终端中依次执行（#后内容为注释）：",{"type":17,"tag":35,"props":384,"children":385},{},[386],{"type":17,"tag":110,"props":387,"children":389},{"alt":7,"src":388},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/cd1526c8c1a44f0ca511802d85254027.png",[],{"type":17,"tag":35,"props":391,"children":392},{},[393],{"type":17,"tag":110,"props":394,"children":396},{"alt":7,"src":395},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/a28a063c34f946e68787b525c80b64d0.png",[],{"type":17,"tag":398,"props":399,"children":401},"pre",{"code":400},"\nsudo su #下面会要求输入密码，默认为Mind@123，输入的时候不会显示键入的字符, 输入完成后进入root用户\n",[402],{"type":17,"tag":403,"props":404,"children":405},"code",{"__ignoreMap":7},[406],{"type":23,"value":400},{"type":17,"tag":35,"props":408,"children":409},{},[410],{"type":23,"value":411},"此时用户切换为root用户，终端提示变为root：",{"type":17,"tag":35,"props":413,"children":414},{},[415],{"type":17,"tag":110,"props":416,"children":418},{"alt":7,"src":417},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/dfd86fc217a544c596af2e60e50e9c46.png",[],{"type":17,"tag":35,"props":420,"children":421},{},[422],{"type":23,"value":423},"运行下面命令授予下载的两个安装包运行权限：",{"type":17,"tag":398,"props":425,"children":427},{"code":426},"\nchmod +x Ascend*\n",[428],{"type":17,"tag":403,"props":429,"children":430},{"__ignoreMap":7},[431],{"type":23,"value":426},{"type":17,"tag":35,"props":433,"children":434},{},[435],{"type":23,"value":436},"运行下面命令安装toolkit包，安装约需要10分钟，请耐心等待：",{"type":17,"tag":398,"props":438,"children":440},{"code":439},"\n./Ascend-cann-toolkit_8.0.RC3.alpha002_linux-aarch64.run --install\n",[441],{"type":17,"tag":403,"props":442,"children":443},{"__ignoreMap":7},[444],{"type":23,"value":439},{"type":17,"tag":35,"props":446,"children":447},{},[448],{"type":23,"value":449},"按照提示键入'Y'。",{"type":17,"tag":35,"props":451,"children":452},{},[453],{"type":23,"value":454},"运行下面命令安装kernels包，安装约需要10分钟，请耐心等待：",{"type":17,"tag":398,"props":456,"children":458},{"code":457},"\n./Ascend-cann-kernels-310b_8.0.RC3.alpha002_linux.run --install\n",[459],{"type":17,"tag":403,"props":460,"children":461},{"__ignoreMap":7},[462],{"type":23,"value":457},{"type":17,"tag":35,"props":464,"children":465},{},[466],{"type":23,"value":449},{"type":17,"tag":35,"props":468,"children":469},{},[470],{"type":23,"value":471},"kernels安装完成后请运行以下命令：",{"type":17,"tag":398,"props":473,"children":475},{"code":474},"\nls /usr/local/Ascend/ascend-toolkit/latest/opp/built-in/op_impl/ai_core/tbe/kernel/\n",[476],{"type":17,"tag":403,"props":477,"children":478},{"__ignoreMap":7},[479],{"type":23,"value":474},{"type":17,"tag":35,"props":481,"children":482},{},[483],{"type":23,"value":484},"将会输出下面内容：",{"type":17,"tag":35,"props":486,"children":487},{},[488],{"type":17,"tag":110,"props":489,"children":491},{"alt":7,"src":490},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/fc2b12e4930743eb94d8084f07e6e1e0.png",[],{"type":17,"tag":35,"props":493,"children":494},{},[495],{"type":23,"value":496},"如果输出不正确需要重新安装CANN。",{"type":17,"tag":35,"props":498,"children":499},{},[500],{"type":23,"value":501},"安装完成后终端执行：",{"type":17,"tag":398,"props":503,"children":505},{"code":504},"\nexit\n",[506],{"type":17,"tag":403,"props":507,"children":508},{"__ignoreMap":7},[509],{"type":23,"value":504},{"type":17,"tag":35,"props":511,"children":512},{},[513],{"type":23,"value":514},"退出root用户，此时终端又变回：",{"type":17,"tag":35,"props":516,"children":517},{},[518],{"type":17,"tag":110,"props":519,"children":521},{"alt":7,"src":520},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/b4bf3bcba21f4f4cb5468a137b52442e.png",[],{"type":17,"tag":35,"props":523,"children":524},{},[525],{"type":23,"value":526},"运行下面命令设置环境变量（当前用户需要为HwHiAiUser）：",{"type":17,"tag":398,"props":528,"children":530},{"code":529},"\necho \"source /usr/local/Ascend/ascend-toolkit/set_env.sh\" >> ~/.bashrc\nsource ~/.bashrc\n",[531],{"type":17,"tag":403,"props":532,"children":533},{"__ignoreMap":7},[534],{"type":23,"value":529},{"type":17,"tag":124,"props":536,"children":538},{"id":537},"_4",[],{"type":17,"tag":35,"props":540,"children":541},{},[542],{"type":17,"tag":30,"props":543,"children":544},{},[545],{"type":23,"value":546},"02",{"type":17,"tag":35,"props":548,"children":549},{},[550],{"type":17,"tag":30,"props":551,"children":552},{},[553],{"type":23,"value":554},"MindSpore安装",{"type":17,"tag":124,"props":556,"children":558},{"id":557},"_1依赖包安装",[559],{"type":17,"tag":30,"props":560,"children":561},{},[562],{"type":23,"value":563},"1、依赖包安装",{"type":17,"tag":35,"props":565,"children":566},{},[567],{"type":23,"value":568},"我们需要安装2.4.10版本的MindSpore，在安装MindSpore之前需要安装MindSpore依赖包，在终端中运行：",{"type":17,"tag":398,"props":570,"children":572},{"code":571},"pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple\npip install sympy\npip install /usr/local/Ascend/ascend-toolkit/latest/lib64/te-*-py3-none-any.whl\npip install /usr/local/Ascend/ascend-toolkit/latest/lib64/hccl-*-py3-none-any.whl\n",[573],{"type":17,"tag":403,"props":574,"children":575},{"__ignoreMap":7},[576],{"type":23,"value":571},{"type":17,"tag":124,"props":578,"children":580},{"id":579},"_2mindspore安装",[581],{"type":17,"tag":30,"props":582,"children":583},{},[584],{"type":23,"value":585},"2、MindSpore安装",{"type":17,"tag":35,"props":587,"children":588},{},[589,591,597],{"type":23,"value":590},"安装完成后开始安装MindSpore2.4.10版本，进入MindSpore官网：",{"type":17,"tag":53,"props":592,"children":595},{"href":593,"rel":594},"https://www.mindspore.cn/",[57],[596],{"type":23,"value":593},{"type":23,"value":598},"。",{"type":17,"tag":35,"props":600,"children":601},{},[602],{"type":17,"tag":110,"props":603,"children":605},{"alt":7,"src":604},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/5cc066bde8e64150bbf3d92ccd0539fe.png",[],{"type":17,"tag":35,"props":607,"children":608},{},[609],{"type":23,"value":610},"选择对应的MindSpore、Python、CANN版本（本次安装配置和截图一致）。然后将安装命令复制到命令行执行即可。",{"type":17,"tag":124,"props":612,"children":614},{"id":613},"_3验证是否安装成功",[615],{"type":17,"tag":30,"props":616,"children":617},{},[618],{"type":23,"value":619},"3、验证是否安装成功",{"type":17,"tag":35,"props":621,"children":622},{},[623],{"type":23,"value":624},"MindSpore安装完成后，执行下面命令验证是否安装成功。",{"type":17,"tag":398,"props":626,"children":628},{"code":627},"python -c \"import mindspore;mindspore.set_context(device_target='Ascend');mindspore.run_check()\"\n",[629],{"type":17,"tag":403,"props":630,"children":631},{"__ignoreMap":7},[632],{"type":23,"value":627},{"type":17,"tag":35,"props":634,"children":635},{},[636],{"type":23,"value":637},"应输出如下结果：",{"type":17,"tag":35,"props":639,"children":640},{},[641],{"type":17,"tag":110,"props":642,"children":644},{"alt":7,"src":643},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/84ec0cb2b4ef4133b3187755e7d40009.png",[],{"type":17,"tag":124,"props":646,"children":648},{"id":647},"_03-安装mindspore-nlp",[649,654,656],{"type":17,"tag":30,"props":650,"children":651},{},[652],{"type":23,"value":653},"03",{"type":23,"value":655}," ",{"type":17,"tag":30,"props":657,"children":658},{},[659],{"type":23,"value":660},"安装MindSpore NLP",{"type":17,"tag":35,"props":662,"children":663},{},[664],{"type":23,"value":665},"请注意以下所有命令均在HwHiAiUser用户下运行。",{"type":17,"tag":35,"props":667,"children":668},{},[669],{"type":23,"value":670},"首先下载MindSpore NLP的代码，这里对janus做了适配，终端中执行以下命令从源码安装MindSpore NLP:",{"type":17,"tag":398,"props":672,"children":674},{"code":673},"\ncd ~\ngit clone https://gitee.com/mindspore-lab/mindnlp.git\ncd mindnlp\ngit checkout janus\npip install -e .\n",[675],{"type":17,"tag":403,"props":676,"children":677},{"__ignoreMap":7},[678],{"type":23,"value":673},{"type":17,"tag":25,"props":680,"children":682},{"id":681},"运行案例",[683],{"type":17,"tag":30,"props":684,"children":685},{},[686],{"type":23,"value":681},{"type":17,"tag":35,"props":688,"children":689},{},[690],{"type":23,"value":665},{"type":17,"tag":124,"props":692,"children":694},{"id":693},"_01-下载janus模型权重",[695,699,700],{"type":17,"tag":30,"props":696,"children":697},{},[698],{"type":23,"value":303},{"type":23,"value":655},{"type":17,"tag":30,"props":701,"children":702},{},[703],{"type":23,"value":704},"下载janus模型权重",{"type":17,"tag":35,"props":706,"children":707},{},[708],{"type":23,"value":709},"终端中执行以下命令:",{"type":17,"tag":398,"props":711,"children":713},{"code":712},"\npip install modelscope\n\n\nmodelscope download --model deepseek-ai/Janus-Pro-1B  --local_dir  /home/HwHiAiUser/Janus-Pro-1B\n",[714],{"type":17,"tag":403,"props":715,"children":716},{"__ignoreMap":7},[717],{"type":23,"value":712},{"type":17,"tag":35,"props":719,"children":720},{},[721],{"type":23,"value":722},"这里需要等待较长时间，具体时间取决于网速。",{"type":17,"tag":35,"props":724,"children":725},{},[726],{"type":23,"value":727},"下载完成后模型权重将保存在/home/HwHiAiUser/Janus-Pro-1B中，如果要保存在其他位置，请修改local_dir参数，并同步修改mindnlp/llm/inference/janus_pro/understanding.py和mindnlp/llm/inference/janus_pro/generation.py中的model_path修改为对应的目录地址。",{"type":17,"tag":35,"props":729,"children":730},{},[731],{"type":17,"tag":110,"props":732,"children":734},{"alt":7,"src":733},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/9e0c95722b8e4ff885a77f737eb8c1c7.png",[],{"type":17,"tag":124,"props":736,"children":738},{"id":737},"_02-运行模型",[739,743,744],{"type":17,"tag":30,"props":740,"children":741},{},[742],{"type":23,"value":546},{"type":23,"value":655},{"type":17,"tag":30,"props":745,"children":746},{},[747],{"type":23,"value":748},"运行模型",{"type":17,"tag":35,"props":750,"children":751},{},[752],{"type":17,"tag":30,"props":753,"children":754},{},[755],{"type":23,"value":756},"注意，由于模型占用内存较多，没有设置swap请设置swap，swap参考前述用户手册的3.18节。",{"type":17,"tag":124,"props":758,"children":760},{"id":759},"_1运行图像理解样例",[761],{"type":17,"tag":30,"props":762,"children":763},{},[764],{"type":23,"value":765},"1、运行图像理解样例",{"type":17,"tag":35,"props":767,"children":768},{},[769],{"type":23,"value":770},"运行图像理解**任务，**在终端中输入：",{"type":17,"tag":398,"props":772,"children":774},{"code":773},"\npip install attrdict\ncd ~/mindnlp/llm/inference/janus_pro\npython understanding.py\n",[775],{"type":17,"tag":403,"props":776,"children":777},{"__ignoreMap":7},[778],{"type":23,"value":773},{"type":17,"tag":35,"props":780,"children":781},{},[782,787],{"type":17,"tag":30,"props":783,"children":784},{},[785],{"type":23,"value":786},"该案例",{"type":23,"value":788},"输入的图像如下：",{"type":17,"tag":35,"props":790,"children":791},{},[792],{"type":17,"tag":110,"props":793,"children":795},{"alt":7,"src":794},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/e1eb41d1dc1c4c168bc5b04b3af735d5.png",[],{"type":17,"tag":35,"props":797,"children":798},{},[799],{"type":23,"value":800},"运行结果为：",{"type":17,"tag":35,"props":802,"children":803},{},[804],{"type":17,"tag":110,"props":805,"children":807},{"alt":7,"src":806},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/16422c55b1cf476b83a11d6e8b7a1f9c.png",[],{"type":17,"tag":124,"props":809,"children":811},{"id":810},"_2运行图像生成案例",[812],{"type":17,"tag":30,"props":813,"children":814},{},[815],{"type":23,"value":816},"2、运行图像生成案例",{"type":17,"tag":35,"props":818,"children":819},{},[820],{"type":23,"value":821},"运行图像生成任务，在终端中输入：",{"type":17,"tag":398,"props":823,"children":825},{"code":824},"python generation.py\n输入prompt为：A stunning princess from kabul in red, white traditional clothing, blue eyes, brown hair\n",[826],{"type":17,"tag":403,"props":827,"children":828},{"__ignoreMap":7},[829],{"type":23,"value":824},{"type":17,"tag":35,"props":831,"children":832},{},[833],{"type":23,"value":834},"在~/mindnlp/llm/inference/janus_pro/generated_samples目录下生成图像：",{"type":17,"tag":35,"props":836,"children":837},{},[838],{"type":17,"tag":110,"props":839,"children":841},{"alt":7,"src":840},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/02/14/54048b16211d4b64a2ae46d36b6f2a76.png",[],{"title":7,"searchDepth":843,"depth":843,"links":844},4,[845,847,848,852,856,860,862,865],{"id":27,"depth":846,"text":27},3,{"id":71,"depth":846,"text":71},{"id":116,"depth":846,"text":122,"children":849},[850,851],{"id":126,"depth":843,"text":132},{"id":175,"depth":843,"text":181},{"id":208,"depth":846,"text":214,"children":853},[854,855],{"id":217,"depth":843,"text":223},{"id":263,"depth":843,"text":269},{"id":287,"depth":846,"text":287,"children":857},[858,859],{"id":7,"depth":843,"text":7},{"id":314,"depth":843,"text":320},{"id":324,"depth":861,"text":7},2,{"id":346,"depth":861,"text":7,"children":863},[864],{"id":367,"depth":843,"text":373},{"id":376,"depth":861,"text":7,"children":866},[867,868,869,870,871,873],{"id":537,"depth":843,"text":7},{"id":557,"depth":843,"text":563},{"id":579,"depth":843,"text":585},{"id":613,"depth":843,"text":619},{"id":647,"depth":843,"text":872},"03 安装MindSpore NLP",{"id":681,"depth":846,"text":681,"children":874},[875,877,879,880],{"id":693,"depth":843,"text":876},"01 下载janus模型权重",{"id":737,"depth":843,"text":878},"02 运行模型",{"id":759,"depth":843,"text":765},{"id":810,"depth":843,"text":816},"markdown","content:news:zh:3610.md","content","news/zh/3610.md","news/zh/3610","md",1776506086037]