File size: 2,665 Bytes
3b6e4c5
 
 
 
 
 
697f377
3b6e4c5
 
 
 
 
 
 
 
f6eaf43
697f377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6eaf43
 
697f377
f6eaf43
697f377
 
 
 
 
 
f6eaf43
697f377
f6eaf43
697f377
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
title: iWorld-Bench Leaderboard
emoji: 🌍
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: "4.44.1"
python_version: "3.12"
app_file: app.py
pinned: false
---

# iWorld-Bench Leaderboard

A comprehensive benchmark for interactive world models.

## Local run

```bash
pip install -r requirements.txt
python app.py
```

If you deploy in Docker and Gradio reports that localhost is not accessible, set environment variable `GRADIO_SHARE=true`. On Hugging Face Spaces the default (`share` off) is correct.

## Deploy to Hugging Face Space(与本地 `readme更新.txt` 一致)

网页新建 Space:Licence MIT、SDK **Gradio**、硬件 CPU basic、Public。复制 Git 地址 `https://huggingface.co/spaces/<用户名>/<Space名>`。

在 **WSL****Git Bash** 中(路径请改成你的仓库位置):

```bash
# 0. 进入项目根目录(含 app.py)
cd /mnt/d/lab/Thu_lab/iworld-bench

# 1. CLI(若 requirements 里已包含可跳过)
pip install -U "huggingface_hub[cli]"

# 2. 登录(Token:https://huggingface.co/settings/tokens )
huggingface-cli login

# 3. 确认登录
huggingface-cli whoami

# 4. 若尚未初始化 git(可选)
# git init

# 5. 添加远程(把 <用户名>/<Space名> 换成你的)
git remote add origin https://huggingface.co/spaces/<用户名>/<Space名>
# 若已存在 origin,用:git remote set-url origin https://huggingface.co/spaces/<用户名>/<Space名>

# 6. 拉取 Space 自动生成的小提交(若失败可跳过)
git pull origin main --allow-unrelated-histories
# 若没有 main:git branch -M main

# 7. 只添加需要上云的文件(不要 add bench/、不要 add zip)
git add README.md app.py requirements.txt data/results.csv
find src -name '*.py' -not -path 'src/bench/*' -exec git add {} +

# 8. 提交并推送
git commit -m "Deploy iWorld-Bench leaderboard"
git push -u origin main
```

推送后在 Space 页面 **⋯ → Restart Space**。若构建失败,在 Space **Settings → Repository secrets** 可设变量 `GRADIO_SHARE`(一般留空即可;仅当你自建 Docker 且报 localhost 相关错误时再设为 `true`)。

Windows 若只用 PowerShell 且没有 `find`,可改用:

```powershell
git add README.md app.py requirements.txt data/results.csv
Get-ChildItem -Path src -Filter *.py -Recurse | Where-Object { $_.FullName -notmatch '\\bench\\' } | ForEach-Object { git add $_.FullName }
```

## Dependency note

Keep `starlette<1.0` (see `requirements.txt`). Starlette 1.0 changed `TemplateResponse`; Gradio 4.44.x is built for the older API. Installing Starlette 1.x can cause `TypeError: unhashable type: 'dict'` when loading the Gradio UI.