海外访问:www.kdjingpai.com
Ctrl + D 收藏本站
当前位置:首页 » AI答疑

如何安装和运行 GPT-OSS 模型?

2025-08-14 162

安装和运行 GPT-OSS 模型需要以下步骤:

  1. 下载模型权重:通过 huggingface-cli 从 Hugging Face 平台下载,例如:huggingface-cli download openai/gpt-oss-120b --include 'original/*' --local-dir gpt-oss-120b/
  2. 配置 Python 环境:建议使用 Python 3.12 创建虚拟环境,并安装 transformers、accelerate 和 torch 等依赖包
  3. 运行模型:可以通过多种方式运行,包括 Transformers 实现、vLLM 实现、Ollama 实现等。例如使用 Transformers 加载模型:pipe = pipeline('text-generation', model='openai/gpt-oss-20b', torch_dtype='auto', device_map='auto')

注意必须使用 Harmony 格式,否则模型无法正常工作。对于 Apple Silicon 设备,还需要将权重转换为 Metal 格式。

找不到AI工具?在这试试!

输入关键词,即可 无障碍访问 必应 搜索,快速找到本站所有 AI 工具。

回顶部

zh_CN简体中文