Spaces:
Configuration error
Configuration error
Download async_framework/config.py from Prabha-AIMLOPS/async-framework: direct link, hf CLI and curl.
- Browser
- Download file 933 Bytes
-
https://huggingface.co/spaces/Prabha-AIMLOPS/async-framework/resolve/main/async_framework/config.py
- Command line
-
hf download hf://spaces/Prabha-AIMLOPS/async-framework/async_framework/config.py
-
curl -L -o config.py https://huggingface.co/spaces/Prabha-AIMLOPS/async-framework/resolve/main/async_framework/config.py
933 Bytes
| from typing import Optional | |
| from pydantic import BaseModel, Field | |
| class RedisConfig(BaseModel): | |
| host: str = Field(default="localhost") | |
| port: int = Field(default=6379) | |
| db: int = Field(default=0) | |
| password: Optional[str] = Field(default=None) | |
| ssl: bool = Field(default=False) | |
| connection_pool_size: int = Field(default=10) | |
| class RetryConfig(BaseModel): | |
| max_retries: int = Field(default=3) | |
| initial_delay: float = Field(default=1.0) # seconds | |
| max_delay: float = Field(default=60.0) # seconds | |
| backoff_factor: float = Field(default=2.0) | |
| class BrokerConfig(BaseModel): | |
| redis: RedisConfig = Field(default_factory=RedisConfig) | |
| retry: RetryConfig = Field(default_factory=RetryConfig) | |
| num_workers: int = Field(default=1) | |
| batch_size: int = Field(default=10) | |
| polling_interval: float = Field(default=1.0) # seconds | |
| metrics_port: int = Field(default=8000) | |