Spaces:
Running
on
Zero
Running
on
Zero
File size: 556 Bytes
d958a06 9ceeef6 d958a06 fd09229 d958a06 fd09229 d958a06 571cb14 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 |
import os
import torch
from dataclasses import dataclass
@dataclass
class Config:
# Gemma3n model configuration
MODEL_NAME: str = "google/gemma-3n-E4B-it"
# Generation parameters
MAX_NEW_TOKENS: int = 512
# Device configuration
TORCH_DTYPE: str = torch.bfloat16
if torch.cuda.is_available():
DEVICE_MAP: str = "cuda:0" # Use first GPU if available
else:
DEVICE_MAP: str = "cpu"
# Image preprocessing
IMAGE_SIZE: int = 512
# Hugging Face token
HF_TOKEN: str = os.getenv("HF_TOKEN", "")
|