Skip to content

Commit

Permalink
add: reader and hugging face.
Browse files Browse the repository at this point in the history
  • Loading branch information
leafmoes committed Nov 5, 2024
1 parent 338730e commit d6a3a6e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
23 changes: 23 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,29 @@ npm install

3. 打开文件 /api/index.js ,取消最后一行的注释,然后执行 `npm run publish:cf`

### Hugging Face

1. 创建一个新空间:[Create a new Space ](https://huggingface.co/new-space)
```
Space name:ddg-chat
License: MIT
Select the Space SDK: docker (Blank)
Space hardware: free
```
2. 设置环境变量
转到 Settings -> Variables and secrets -> Variables 配置环境变量
貌似必须设置 `API_PREFIX`,由于抱抱脸的限制?
环境变量在帖子里面
3. 编辑 README.md 文件
在 metadata 添加 `app_port: 8787` 这个 8787 取决于你 docker 镜像的端口
4. 添加 Dockerfile 文件:
```
FROM docker.io/leafmoes/ddg-chat:latest
```
### Docker
方法一:命令行构建
Expand Down
20 changes: 20 additions & 0 deletions render.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "1"
services:
- type: web
name: ddg-chat
runtime: node
repo: https://github.com/leafmoes/ddg-chat
plan: free
envVars:
- key: API_PREFIX
generateValue: '/'
- key: API_KEY
sync: false
- key: MAX_RETRY_COUNT
generateValue: 3
- key: RETRY_DELAY
generateValue: 5000
region: singapore
buildCommand: npm install
startCommand: npm start
healthCheckPath: /

0 comments on commit d6a3a6e

Please sign in to comment.