File size: 671 Bytes
d958a06
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import os
import torch
from dataclasses import dataclass


@dataclass
class Config:
    # Gemma3n model configuration
    MODEL_NAME: str = "google/gemma-3n-E2B-it"

    # Generation parameters
    MAX_NEW_TOKENS: int = 256
    TEMPERATURE: float = 0.3
    DO_SAMPLE: bool = True
    TOP_P: float = 0.8
    TOP_K: int = 40

    # Device configuration
    TORCH_DTYPE: str = torch.bfloat16
    DEVICE_MAP: str = "auto"

    # Image preprocessing
    IMAGE_SIZE: int = 512 

    # Hugging Face token
    HF_TOKEN: str = os.getenv("HF_TOKEN", "")

    # Gradio configuration
    GRADIO_SHARE: bool = False
    GRADIO_PORT: int = 7860
    GRADIO_SERVER_NAME: str = "0.0.0.0"