File size: 806 Bytes
fe5f1bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 远端 Space 日志(本地 debug 用)

用 HF API 拉取构建/运行日志,便于本地排查问题。需 `HF_TOKEN`(有该 Space 权限)。

## 容器运行日志(SSE)

```bash
curl -N \
  -H "Authorization: Bearer $HF_TOKEN" \
  "https://huggingface.co/api/spaces/tao-shen/HuggingRun/logs/run"
```

## 构建日志(SSE)

```bash
curl -N \
  -H "Authorization: Bearer $HF_TOKEN" \
  "https://huggingface.co/api/spaces/tao-shen/HuggingRun/logs/build"
````tao-shen/HuggingRun` 换成你的 `SPACE_ID`(例如 `你的用户名/你的Space名`)。

## 在脚本里用

```bash
# 拉取最近一段运行日志(Ctrl+C 结束)
HF_TOKEN=your_token ./scripts/monitor_and_test.py --logs run

# 拉取构建日志
HF_TOKEN=your_token ./scripts/monitor_and_test.py --logs build
```