本地部署 torchchat的详细过程
本地部署 torchchat
0. 引言
TorchChat 是一个小型代码库,展示了无缝运行大型语言模型 (LLMs) 的能力。使用 torchchat,您可以在自己的 (C/C++) 应用程序(桌面或服务器)以及 iOS 和 Android 上使用 Python 运行LLMs。
1. 本地部署
1-1. 创建虚拟环境
1-2. 克隆代
1-3. 安装依赖模块
(20240816时点)我的wls-ubuntu环境会报以下错误,
+ python scripts/patch_triton.py /mnt/e/workspace/torchchat/scripts/patch_triton.py:20: SyntaxWarning: invalid escape sequence '\s' new_match = 'self.src = self.src[re.search(r"^def\s+\w+\s*\(", self.src, re.MULTILINE).start():]'
临时解决方法,
vi /mnt/e/workspace/torchchat/scripts/patch_triton.py --- # new_match = 'self.src = self.src[re.search(r"^def\s+\w+\s*\(", self.src, re.MULTILINE).start():]' new_match = r'self.src = self.src[re.search(r"^def\s+\w+\s*\(", self.src, re.MULTILINE).start():]' ---
重新运行,
1-4. 下载模型
登录 Hugging Face,完成此操作后,torchchat 将能够从 Hugging Face 下载模型工件。
查看现在支持的模型,
# python3 torchchat.py list Model Aliases Downloaded --------------------------------------- ------------------------------------------- ----------- meta-llama/llama-2-7b-hf llama2-base, llama2-7b meta-llama/llama-2-7b-chat-hf llama2, llama2-chat, llama2-7b-chat meta-llama/llama-2-13b-chat-hf llama2-13b-chat meta-llama/llama-2-70b-chat-hf llama2-70b-chat meta-llama/meta-llama-3-8b llama3-base meta-llama/meta-llama-3-8b-instruct llama3, llama3-chat, llama3-instruct meta-llama/meta-llama-3-70b-instruct llama3-70b meta-llama/meta-llama-3.1-8b llama3.1-base meta-llama/meta-llama-3.1-8b-instruct llama3.1, llama3.1-chat, llama3.1-instruct Yes meta-llama/meta-llama-3.1-70b-instruct llama3.1-70b meta-llama/codellama-7b-python-hf codellama, codellama-7b meta-llama/codellama-34b-python-hf codellama-34b mistralai/mistral-7b-v0.1 mistral-7b-v01-base mistralai/mistral-7b-instruct-v0.1 mistral-7b-v01-instruct mistralai/mistral-7b-instruct-v0.2 mistral, mistral-7b, mistral-7b-instruct openlm-research/open_llama_7b open-llama, open-llama-7b stories15m stories42m stories110m
您可能感兴趣的文章
- 09-18鸿蒙系统中的Webview技术使用方法详解
- 09-18elasticsearch.yml配置文件解读(ES配置详解)
- 09-18鸿蒙(HarmonyOS)实现隐私政策弹窗效果
- 09-18Hive 判断某个字段长度的示例代码
- 09-18本地部署 torchchat的详细过程
- 09-18JSON常用的几种注释代码示例
- 09-18ToDesk安装与使用教程(全平台支持)
- 09-18鸿蒙HarmonyOS开发:Navigation路由导航功能和实践
- 09-18Markdown语法手册—完整笔记整理
- 09-18Typora2024最新版使用方法步骤详解(亲测可用)
阅读排行
推荐教程
- 09-18本地部署 torchchat的详细过程
- 09-18鸿蒙HarmonyOS开发:Navigation路由导航功能和实践
- 09-18鸿蒙系统中的Webview技术使用方法详解
- 09-18elasticsearch.yml配置文件解读(ES配置详解)
- 09-18JSON常用的几种注释代码示例
- 09-18鸿蒙(HarmonyOS)实现隐私政策弹窗效果
- 09-18Markdown语法手册—完整笔记整理
- 09-18Hive 判断某个字段长度的示例代码
- 09-18ToDesk安装与使用教程(全平台支持)
- 09-18Typora2024最新版使用方法步骤详解(亲测可用)