File size: 1,010 Bytes
4a2546a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
def init_chute(username: str, name: str) -> Chute:
    image = (
        ChutesImage(
            username=username,
            name=name,
            tag="latest",
        )
        .from_base("parachutes/python:3.12")
        .run_command("pip install --upgrade setuptools wheel")
        .run_command(
            "pip install huggingface_hub==0.19.4")
        .run_command(
            # RAG-specific dependencies
            # Note: faiss-cpu 1.8.0+ supports Python 3.12
            "pip install sentence-transformers==2.2.2 faiss-cpu pydantic chutes==0.3.61"
        )
        .set_workdir("/app")
    )

    node_selector = NodeSelector(
        gpu_count=1,
        min_vram_gb_per_gpu=16,  # RAG uses less GPU than transformers
    )
    return Chute(
        username=username,
        name=name,
        image=image,
        node_selector=node_selector,
        concurrency=4,
        timeout_seconds=300,
        shutdown_after_seconds=36000,  # 10 hours - prevents cooldowns during testing
    )