Commit d40847f1 authored by jameskrw's avatar jameskrw
Browse files

update service and service config

parent b7b6b2cf
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
from .sokoban import SokobanEnv,SokobanConfig
from .frozenlake import FrozenLakeEnv,FrozenLakeConfig, FrozenLakeService
from .navigation import NavigationEnv, NavigationConfig
from .svgdino import SVGDINOEnv, SVGDINOConfig
from .svg import SVGEnv, SVGConfig, SVGService

REGISTERED_ENV = {
@@ -23,8 +22,5 @@ REGISTERED_ENV = {
        "config_cls": SVGConfig,
        "service_cls": SVGService
    },
    "svgdino": {
        "env_cls": SVGDINOEnv,
        "config_cls": SVGDINOConfig,
    }
    
}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ from dataclasses import dataclass, field
from abc import ABC, abstractmethod
from typing import Optional, List, Union
@dataclass
class BaseConfig(ABC):
class BaseEnvConfig(ABC):
    format_reward: float = 0.5
    image_placeholder: str = "<image>"
    special_token_list: Optional[List[str]] = field(default_factory=lambda: ["<think>", "</think>", "<answer>", "</answer>"])
+19 −0
Original line number Diff line number Diff line
from dataclasses import dataclass, field
from abc import ABC, abstractmethod
from typing import Optional, List, Union
@dataclass
class BaseServiceConfig(ABC):
    max_workers: int = 10
    
    
    def __init__(self, **kwargs):
        pass
    
    def get(self, key, default=None):
        """
        Get the value of a config key.
        Args:
            key: Key to get
            default: Default value if key is not found
        """
        return getattr(self, key, default)
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
from .config import FrozenLakeConfig
from .env_config import FrozenLakeConfig
from .env import FrozenLakeEnv
from .service import FrozenLakeService
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ from gymnasium.envs.toy_text.frozen_lake import FrozenLakeEnv as GymFrozenLakeEn
from vagen.env.utils.env_utils import NoLoggerWarnings, set_seed
from vagen.env.utils.context_utils import parse_llm_raw_response, convert_numpy_to_PIL
from .prompt import system_prompt_text, system_prompt_vision, init_observation_template, action_template
from .config import FrozenLakeConfig
from .env_config import FrozenLakeConfig
from .utils import generate_random_map, is_valid

class FrozenLakeEnv(BaseEnv):
Loading