File size: 1,757 Bytes
bc02199
 
 
 
783b7b3
bc02199
 
 
783b7b3
bc02199
 
783b7b3
bc02199
 
 
783b7b3
bc02199
 
783b7b3
bc02199
 
 
783b7b3
bc02199
 
783b7b3
bc02199
 
 
783b7b3
bc02199
 
783b7b3
bc02199
 
 
783b7b3
bc02199
 
783b7b3
bc02199
 
 
783b7b3
bc02199
 
 
 
 
 
783b7b3
 
 
 
dd6cefc
783b7b3
 
dd6cefc
783b7b3
 
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
"""Stable example objects for the initial mock MVP."""

EXAMPLE_OBJECTS = [
    {
        "archive_id": "OVD-001",
        "label": "Coffee mug / 咖啡杯",
        "description": "old white coffee mug on a developer desk",
        "mode": "Cynical",
        "tags": "Everyday · Warmth",
    },
    {
        "archive_id": "OVD-002",
        "label": "Mechanical keyboard / 机械键盘",
        "description": "dusty black mechanical keyboard in an office",
        "mode": "Philosopher",
        "tags": "Work · Habit",
    },
    {
        "archive_id": "OVD-003",
        "label": "Running shoe / 跑鞋",
        "description": "worn running shoe near the bedroom door",
        "mode": "Lonely",
        "tags": "Journey · Wear",
    },
    {
        "archive_id": "OVD-004",
        "label": "Desk lamp / 台灯",
        "description": "metal desk lamp over late night notes",
        "mode": "Dramatic",
        "tags": "Night · Focus",
    },
    {
        "archive_id": "OVD-005",
        "label": "Water bottle / 水瓶",
        "description": "clear plastic water bottle on a kitchen counter",
        "mode": "Romantic",
        "tags": "Routine · Clear",
    },
    {
        "archive_id": "OVD-006",
        "label": "Notebook / 笔记本",
        "description": "old notebook of abandoned project ideas",
        "mode": "Cynical",
        "tags": "Memory · Drafts",
    },
]


def gradio_examples() -> list[list[str]]:
    return [[item["description"]] for item in EXAMPLE_OBJECTS]


def example_button_label(index: int) -> str:
    item = EXAMPLE_OBJECTS[index]
    label = item["label"].split("/")[0].strip()
    return (
        f"{item['archive_id']}\n"
        f"{label}\n"
        f"{item['mode']} · {item['tags']}"
    )