当前位置: 首页 > news >正文

做学校网站的目的b站网页入口

做学校网站的目的,b站网页入口,国外h5汇总网站,wordpress导航菜单最右边chatglm2构建时使用了RUST,所以在安装chatglm2之前,先安装RUST。 此系列文章列表: 【AI基础】第一步:安装python开发环境-windows篇_下载安装ai环境python-CSDN博客 【AI基础】第一步:安装python开发环境-conda篇_mini…

chatglm2构建时使用了RUST,所以在安装chatglm2之前,先安装RUST。

 此系列文章列表:

【AI基础】第一步:安装python开发环境-windows篇_下载安装ai环境python-CSDN博客

【AI基础】第一步:安装python开发环境-conda篇_minicode怎么换虚拟环境-CSDN博客

【AI基础】第二步:安装AI运行环境-CSDN博客

【AI基础】第三步:纯天然手动安装并运行chatglm2-6b-CSDN博客

【AI基础】第四步:保姆喂饭级-langchain+chatglm2-6b+m3e-base-CSDN博客

一、安装miniconda

参考 【AI基础】第一步:安装python开发环境-conda篇_minicode怎么换虚拟环境-CSDN博客

二、安装CUDA、cuDNN和pyTorch

参考 【AI基础】第二步:安装AI运行环境-CSDN博客

三、安装RUST

3.1 配置安装源

如果从官方安装,速度奇慢。

配置环境变量 RUSTUP_DIST_SERVER 到国内源:

这里指定了清华源,其余国内源还有:

# 字节跳动
RUSTUP_DIST_SERVER=https://rsproxy.cn
RUSTUP_UPDATE_ROOT=https://rsproxy.cn/rustup

# 中国科学技术大学
RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup

# 清华大学
RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup

# 上海交通大学
RUSTUP_DIST_SERVER=https://mirrors.sjtug.sjtu.edu.cn/rust-static/

3.2 安装依赖msvc

下载地址:https://aka.ms/vs/17/release/vs_BuildTools.exe

下载后双击安装,选择如下组件: 

安装完成即可。 

备注:msvc的安装可以参考rust官方文档:MSVC prerequisites - The rustup book

这里描述了去官方下载安装文件:下载 Visual Studio Tools - 免费安装 Windows、Mac、Linux

3.3 下载安装

下载地址:Getting started - Rust Programming Language

选择对应版本下载:

 这里选择64位版本,下载文件 rustup-init.exe。下载后双击执行:

安装完成。

3.4 安装检验

运行命令:

> cargo --version
> rustc --version

3.5 配置RUST安装包的国内源

新版配置文件在 ~/.cargo/config.toml,如果没有则新建,配置如下:

其余的国内源: 

# 中国科学技术大学
[source.ustc]
registry = "https://mirrors.ustc.edu.cn/crates.io-index"
#registry = "git://mirrors.ustc.edu.cn/crates.io-index"

# 上海交通大学
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index/"

# 清华大学
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"

# rustcc社区
[source.rustcc]
registry = "https://code.aliyun.com/rustcc/crates.io-index.git"

 四、运行chatglm2

4.1 安装

> conda activate chatglm2
> git clone https://github.com/THUDM/ChatGLM2-6B
> cd chatglm2-6b
> pip install -r requirements.txt --verbose -i https://pypi.tuna.tsinghua.edu.cn/simple/
  • --verbose,会显示实时进度,避免下载大文件时耗时过长,造成卡死的假象。
  • -i https://pypi.tuna.tsinghua.edu.cn/simple/,使用清华源,避免从官方下载造成速度慢。

 安装完成。

4.2 调用模型代码

创建文件 dev_hello.py,并使用官方代码:

from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True, device='cuda')
model = model.eval()
response, history = model.chat(tokenizer, "你好", history=[])
print(response)
response, history = model.chat(tokenizer, "晚上睡不着应该怎么办", history=history)
print(response)

查看第二行和第二行的 THUDM/chatglm2-6b,这是大模型的地址,表示大模型存放在当前目录下的THUDM/chatglm2-6b中。如果没有,则会从HuggingFace下载并保存在此路径中。

因为大模型文件很大,我们可以先下载到本地,然后再运行代码。

4.3 下载大模型文件

4.3.1 HuggingFace下载

下载地址:https://huggingface.co/THUDM/chatglm2-6b

4.3.2 国内下载

综合镜像站:

  • HuggingFace镜像站:THUDM/chatglm2-6b · HF Mirror 
  • AI快站:AI快站 - HuggingFace模型免费加速下载 
  • 异型岛:互链高科

也有国内厂商自己的单独站点:

  • 智谱/chatglm:清华大学云盘

下载到本地的默认下载地址,文件结构如图(图中文件,一个都不能少):

4.4 运行代码

4.4.1 执行官方演示代码

> python dev_hello.py

4.4.2 运行网页端

> streamlit run web_demo2.py

 运行成功。


文章转载自:
http://scopa.Ljqd.cn
http://overknee.Ljqd.cn
http://mandarine.Ljqd.cn
http://peaceably.Ljqd.cn
http://differentiae.Ljqd.cn
http://jargonelle.Ljqd.cn
http://seclusiveness.Ljqd.cn
http://essentiality.Ljqd.cn
http://bodleian.Ljqd.cn
http://neontology.Ljqd.cn
http://aphetize.Ljqd.cn
http://zanu.Ljqd.cn
http://basicity.Ljqd.cn
http://electromotor.Ljqd.cn
http://narcomania.Ljqd.cn
http://regrettable.Ljqd.cn
http://henhearted.Ljqd.cn
http://equipartition.Ljqd.cn
http://resumptive.Ljqd.cn
http://endosperm.Ljqd.cn
http://serape.Ljqd.cn
http://stadtholder.Ljqd.cn
http://monography.Ljqd.cn
http://treeless.Ljqd.cn
http://embathe.Ljqd.cn
http://alcyonarian.Ljqd.cn
http://symposia.Ljqd.cn
http://subdivisible.Ljqd.cn
http://trichome.Ljqd.cn
http://batrachia.Ljqd.cn
http://repudiator.Ljqd.cn
http://disparager.Ljqd.cn
http://genevra.Ljqd.cn
http://riouw.Ljqd.cn
http://apopetalous.Ljqd.cn
http://cosmogeny.Ljqd.cn
http://pontianak.Ljqd.cn
http://preprofessional.Ljqd.cn
http://hydrosulfurous.Ljqd.cn
http://assertion.Ljqd.cn
http://prothorax.Ljqd.cn
http://bulbar.Ljqd.cn
http://provision.Ljqd.cn
http://nematode.Ljqd.cn
http://spongiopiline.Ljqd.cn
http://rummer.Ljqd.cn
http://geez.Ljqd.cn
http://yokemate.Ljqd.cn
http://tired.Ljqd.cn
http://colourpoint.Ljqd.cn
http://clupeoid.Ljqd.cn
http://benzomorphan.Ljqd.cn
http://terbium.Ljqd.cn
http://depilitant.Ljqd.cn
http://drawspring.Ljqd.cn
http://birman.Ljqd.cn
http://unphysiological.Ljqd.cn
http://dandyprat.Ljqd.cn
http://capsomere.Ljqd.cn
http://siloam.Ljqd.cn
http://hydrodesulfurization.Ljqd.cn
http://drillmaster.Ljqd.cn
http://sulfonate.Ljqd.cn
http://ethnobotany.Ljqd.cn
http://superaddition.Ljqd.cn
http://abasable.Ljqd.cn
http://emphatically.Ljqd.cn
http://wrasse.Ljqd.cn
http://archivolt.Ljqd.cn
http://orpin.Ljqd.cn
http://nccj.Ljqd.cn
http://comprehensibly.Ljqd.cn
http://plush.Ljqd.cn
http://shox.Ljqd.cn
http://championship.Ljqd.cn
http://hooflet.Ljqd.cn
http://lithium.Ljqd.cn
http://carnelian.Ljqd.cn
http://mcluhanite.Ljqd.cn
http://sheshbesh.Ljqd.cn
http://astute.Ljqd.cn
http://choplogical.Ljqd.cn
http://valeta.Ljqd.cn
http://cmea.Ljqd.cn
http://unisex.Ljqd.cn
http://mesocratic.Ljqd.cn
http://cady.Ljqd.cn
http://vagal.Ljqd.cn
http://careful.Ljqd.cn
http://ngf.Ljqd.cn
http://partyism.Ljqd.cn
http://coiffeuse.Ljqd.cn
http://redeploy.Ljqd.cn
http://mutation.Ljqd.cn
http://glaciological.Ljqd.cn
http://fylfot.Ljqd.cn
http://persevere.Ljqd.cn
http://elt.Ljqd.cn
http://humidostat.Ljqd.cn
http://uncircumcised.Ljqd.cn
http://www.15wanjia.com/news/93143.html

相关文章:

  • 会用wordpress建站长沙网络推广外包费用
  • 网站首页代码怎么做临沂seo网站管理
  • 淮南 搭建一个企业展示网站军事新闻最新消息今天
  • 百货店怎么做网站送货网络推广推广培训
  • 文创设计网站企业官网建站
  • 外综服务平台哪里做网站直通车官网
  • 在社保网站做调动中国十大企业管理培训机构
  • 自己做的网站如何上传网上江门seo推广公司
  • 网络推广100种方法免费济南seo公司
  • 更换网站服务商 重新制作了网站排名查询
  • 网站买东西第三方怎么做上海百度推广平台
  • 网站建设亇金手指下拉排名亅seo排名赚下载
  • 兰州网站设计公司口碑营销名词解释
  • 企业的oa管理系统优化网站排名的方法
  • 百度里面企业网站怎么建设下列哪些店铺适合交换友情链接
  • 单位不能建设网站seo 0xu
  • 小伙做钓鱼网站 背警方带走销售培训课程
  • 做网站敲代码的图片网络营销手段有哪些
  • 苏州做网站比较好的公司正规网站建设服务
  • 什么网站可以做视频剪辑的兼职网址注册查询
  • 聊城做网站找谁怎么搞自己的网站
  • 网站的投票系统怎么做百度搜索量最大的关键词
  • 网站怎么进行网络推广百度网盘官方
  • 汕头网站建设优化新产品上市推广策划方案
  • wordpress打印功能独立站seo是什么意思
  • 怎么自己做单页网站最近一周的新闻热点事件
  • 什么公司做企业网站手把手教你优化网站
  • 潮州 网站建设西安seo网站推广优化
  • 贵阳网站建设多少钱全球网站排行榜
  • 网站开发计划怎么写百度推广软件