跳转到内容
搜索文档

Hugging Face Chat UI(Hugging Face 聊天界面)

最后更新 查看 MarkdownAgent 设置

将 Workers AI 与 Chat UI(由 Hugging Face 提供的开源聊天界面)结合使用。

前提条件

你需要以下内容:

设置

首先,决定如何引用 Account ID 和 API token(直接在 .env.local 中使用 CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_API_TOKEN 变量,或在端点配置中指定)。

然后,按照 Chat UI GitHub 仓库 中的其余设置说明操作。

设置模型时,指定 cloudflare 端点。

{
  "name" : "nousresearch/hermes-2-pro-mistral-7b",
  "tokenizer": "nousresearch/hermes-2-pro-mistral-7b",
  "parameters": {
    "stop": ["<|im_end|>"]
  },
  "endpoints" : [
    {
      "type": "cloudflare",
      // optionally specify these if not included in .env.local
      "accountId": "your-account-id",
      "apiToken": "your-api-token"
      //
    }
  ]
}

支持的模型

此模板适用于任何以 @hf 参数开头的文本生成模型

这篇文档对您有帮助吗?