Commit cf78bd77 authored by YaningGao's avatar YaningGao
Browse files

Merge branch 'dev' of github.com:RAGEN-AI/vagen into dev

parents faf90320 d40847f1
Loading
Loading
Loading
Loading
+12 −16
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
from .navigation import NavigationEnv, NavigationConfig
from .svg import SVGEnv, SVGConfig, SVGService

REGISTERED_ENV = {
    "sokoban": {
@@ -14,17 +13,14 @@ REGISTERED_ENV = {
        "config_cls": FrozenLakeConfig,
        "service_cls": FrozenLakeService
    },
    # "navigation": {
    #     "env_cls": NavigationEnv,
    #     "config_cls": NavigationConfig
    # },
    # "svg": {
    #     "env_cls": SVGEnv,
    #     "config_cls": SVGConfig,
    #     "service_cls": SVGService
    # },
    # "svgdino": {
    #     "env_cls": SVGDINOEnv,
    #     "config_cls": SVGDINOConfig,
    # }
    "navigation": {
        "env_cls": NavigationEnv,
        "config_cls": NavigationConfig
    },
    "svg": {
        "env_cls": SVGEnv,
        "config_cls": SVGConfig,
        "service_cls": SVGService
    },
    
}
 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