Skip to content

molmo_spaces

molmo_spaces

Modules:

Name Description
configs

Configuration module for MolmoSpaces experiments.

controllers
data_generation
env
evaluation

Evaluation utilities for MolmoSpaces benchmarks.

grasp_generation
housegen
kinematics
molmo_spaces_constants

Constants and paths for the MolmoSpaces project. Paths should be provided as Path objects.

planner
policy
renderer
resources
robots
tasks
utils

Attributes:

Name Type Description
MOLMO_SPACES_BASE_DIR

MOLMO_SPACES_BASE_DIR module-attribute

MOLMO_SPACES_BASE_DIR = parent

molmo_spaces_constants

Constants and paths for the MolmoSpaces project. Paths should be provided as Path objects.

Overwrite in the environment with e.g.: MLSPACES_ASSETS_DIR=/Users/username/mlspaces_resources mjpython scripts/...

Functions:

Name Description
single_thread_environment
resource_manager_log_level
register_user_asset_library

Register a user-provided asset library. The library dir should contain an assets_index.json

register_user_grasp_library

Register a user-provided grasp library. The library dir should contain a grasps_index.json

get_resource_manager
get_scenes_root
get_asset_id_to_object_type
get_object_type_to_asset_ids
get_scenes
check_in_cache
populate_cache
get_ithor_houses

Return {split: {index: xml_path_or_None}} for iTHOR houses.

get_procthor_10k_houses

Return {split: {index: xml_path_or_None}} for ProcTHOR-10k houses.

get_procthor_objaverse_debug_houses

Return {split: {index: xml_path_or_None}} for ProcTHOR Objaverse houses.

get_procthor_objaverse_houses

Return {split: {index: xml_path_or_None}} for ProcTHOR Objaverse houses.

get_holodeck_objaverse_houses

Return {split: {index: xml_path_or_None}} for ProcTHOR Objaverse houses.

get_robot_paths

Return {robot_name: Path} for all prepackaged MlSpaces robot files.

install_missing_source
get_robot_path

Return the path to the prepackaged MlSpaces robot file for the given robot name.

print_license_info

Attributes:

Name Type Description
ABS_PATH_OF_TOP_LEVEL_MOLMO_SPACES_DIR
DATA_CACHE_DIR
ASSETS_DIR
ROBOTS_DIR
OBJAVERSE_ASSETS_DIR
PINNED_ASSETS_FILE
USE_HUGGING_FACE
DATA_TYPE_TO_SOURCE_TO_VERSION
OBJECT_LIBRARY_TO_GRASP_LIBRARIES
USER_ASSET_LIBRARIES dict[str, Path]
USER_GRASP_LIBRARIES dict[str, Path]
pinned_assets

ABS_PATH_OF_TOP_LEVEL_MOLMO_SPACES_DIR module-attribute

ABS_PATH_OF_TOP_LEVEL_MOLMO_SPACES_DIR = parent

DATA_CACHE_DIR module-attribute

DATA_CACHE_DIR = Path(get('MLSPACES_CACHE_DIR', _DATA_CACHE_DEFAULT))

ASSETS_DIR module-attribute

ASSETS_DIR = Path(get('MLSPACES_ASSETS_DIR', home() / '.cache' / 'molmospaces' / 'assets' / _install_hash))

ROBOTS_DIR module-attribute

ROBOTS_DIR = ASSETS_DIR / 'robots'

OBJAVERSE_ASSETS_DIR module-attribute

OBJAVERSE_ASSETS_DIR = Path(get('MLSPACES_OBJAVERSE_ASSETS_DIR', ASSETS_DIR / 'objects' / 'objaverse'))

PINNED_ASSETS_FILE module-attribute

PINNED_ASSETS_FILE = Path(environ['MLSPACES_PINNED_ASSETS_FILE']) if 'MLSPACES_PINNED_ASSETS_FILE' in environ else None

USE_HUGGING_FACE module-attribute

USE_HUGGING_FACE = False

DATA_TYPE_TO_SOURCE_TO_VERSION module-attribute

DATA_TYPE_TO_SOURCE_TO_VERSION = dict(robots={'rby1': '20251224', 'rby1m': '20251224', 'franka_droid': '20260127', 'franka_cap': '20260213', 'floating_rum': '20251110', 'floating_robotiq': '20260208_retry4', 'franka_fr3': '20260303', 'i2rt_yam': '20260223'}, scenes={'ithor': '20251217_with_occupancy', 'refs': '20250923', 'procthor-10k-train': '20251122_with_occupancy', 'procthor-10k-val': '20251217_with_occupancy', 'procthor-10k-test': '20251121_with_occupancy', 'holodeck-objaverse-train': '20251217_with_occupancy', 'holodeck-objaverse-val': '20251217_with_occupancy', 'procthor-objaverse-train': '20251205_with_occupancy', 'procthor-objaverse-val': '20251205_with_occupancy'}, objects={'thor': '20251117', 'objaverse': '20260131', 'objathor_metadata': '20260129'}, grasps={'droid': '20251116', 'droid_objaverse': '20251218'}, test_data={'franka_pick': '20260610', 'franka_pick_and_place': '20260529', 'rby1_door_opening': '20260228', 'rby1_pnp': '20260610', 'rum_open_close': '20260305', 'rum_pick': '20260209', 'test_randomized_data': '20251209', 'thormap': '20251209'}, benchmarks={'molmospaces-bench-v1': '20260408', 'molmospaces-bench-v2': '20260415'})

OBJECT_LIBRARY_TO_GRASP_LIBRARIES module-attribute

OBJECT_LIBRARY_TO_GRASP_LIBRARIES = {'thor': ['droid'], 'objaverse': ['droid_objaverse']}

USER_ASSET_LIBRARIES module-attribute

USER_ASSET_LIBRARIES: dict[str, Path] = {}

USER_GRASP_LIBRARIES module-attribute

USER_GRASP_LIBRARIES: dict[str, Path] = {}

pinned_assets module-attribute

pinned_assets = load(f)

single_thread_environment

single_thread_environment()
Source code in molmo_spaces/molmo_spaces_constants.py
def single_thread_environment():
    print(f"Setting single thread environment for proc {os.getpid()}")
    try:
        import torch

        if torch.get_num_threads() != 1:
            torch.set_num_threads(1)
        if torch.get_num_interop_threads() != 1:
            torch.set_num_interop_threads(1)

        if os.environ.get("OMP_NUM_THREADS") != "1":
            os.environ["OMP_NUM_THREADS"] = "1"
        if os.environ.get("MKL_NUM_THREADS") != "1":
            os.environ["MKL_NUM_THREADS"] = "1"
    except Exception:
        pass

resource_manager_log_level

resource_manager_log_level(log_level=DEBUG)
Source code in molmo_spaces/molmo_spaces_constants.py
def resource_manager_log_level(log_level=logging.DEBUG):
    logger = logging.getLogger("molmospaces_resources")
    logger.setLevel(log_level)
    if not logger.handlers:
        logger.addHandler(logging.StreamHandler())

register_user_asset_library

register_user_asset_library(name: str, path: Path)

Register a user-provided asset library. The library dir should contain an assets_index.json which contains a dict[str, UserAssetLibraryIndexEntry].

The library name must not conflict with a built-in object source or any other user-provided library.

Parameters:

Name Type Description Default
name str

The name of the user-provided asset library.

required
path Path

The path to the user-provided asset library directory.

required
Source code in molmo_spaces/molmo_spaces_constants.py
def register_user_asset_library(name: str, path: Path):
    """
    Register a user-provided asset library. The library dir should contain an assets_index.json
    which contains a dict[str, UserAssetLibraryIndexEntry].

    The library name must not conflict with a built-in object source or any other user-provided library.

    Args:
        name: The name of the user-provided asset library.
        path: The path to the user-provided asset library directory.
    """
    assert "/" not in name, f"User library name {name} must not contain slashes"
    if name in USER_ASSET_LIBRARIES:
        raise ValueError(f"User library {name} already registered")
    if name in DATA_TYPE_TO_SOURCE_TO_VERSION["objects"]:
        raise ValueError(f"User library {name} name conflicts with a built-in object source")
    if not (path / "assets_index.json").exists():
        raise ValueError(
            f"User library {name} path {path} does not contain an assets_index.json file"
        )
    USER_ASSET_LIBRARIES[name] = path

register_user_grasp_library

register_user_grasp_library(root_name: str, path: Path, object_library: str)

Register a user-provided grasp library. The library dir should contain a grasps_index.json which contains a UserGraspLibraryIndex.

Parameters:

Name Type Description Default
root_name str

The root name of the grasp library, will be used with the robot name to form the grasp library name.

required
path Path

The path to the user-provided grasp library directory.

required
object_library str

The object library (user-provided or built-in) which this grasp library is for. It must have already been registered.

required
Source code in molmo_spaces/molmo_spaces_constants.py
def register_user_grasp_library(root_name: str, path: Path, object_library: str):
    """
    Register a user-provided grasp library. The library dir should contain a grasps_index.json
    which contains a UserGraspLibraryIndex.

    Args:
        root_name: The root name of the grasp library, will be used with the robot name to form the grasp library name.
        path: The path to the user-provided grasp library directory.
        object_library: The object library (user-provided or built-in) which this grasp library is for.
            It must have already been registered.
    """
    grasps_index_path = path / "grasps_index.json"
    if not grasps_index_path.exists():
        raise ValueError(f"{grasps_index_path} does not exist")
    if (
        object_library not in USER_ASSET_LIBRARIES
        and object_library not in DATA_TYPE_TO_SOURCE_TO_VERSION["objects"]
    ):
        raise ValueError(f"Object library {object_library} not found")

    from molmo_spaces.utils.lazy_loading_utils import UserGraspLibraryIndex

    with open(grasps_index_path, "r") as f:
        grasp_index = UserGraspLibraryIndex.model_validate_json(f.read())

    grasp_robots = set(grasp_index.grasp_paths.keys()) | set(
        grasp_index.articulated_grasp_paths.keys()
    )
    grasp_libraries = [f"{root_name}/{robot}" for robot in grasp_robots]

    for grasp_library in grasp_libraries:
        if grasp_library in USER_GRASP_LIBRARIES:
            raise ValueError(f"User grasp library {grasp_library} already registered")
        if grasp_library in DATA_TYPE_TO_SOURCE_TO_VERSION["grasps"]:
            raise ValueError(
                f"User grasp library {grasp_library} name conflicts with a built-in grasp source"
            )

        USER_GRASP_LIBRARIES[grasp_library] = path

        if object_library not in OBJECT_LIBRARY_TO_GRASP_LIBRARIES:
            OBJECT_LIBRARY_TO_GRASP_LIBRARIES[object_library] = []
        # newer grasp libraries have precedence over older ones
        OBJECT_LIBRARY_TO_GRASP_LIBRARIES[object_library].insert(0, grasp_library)

get_resource_manager

get_resource_manager(force_post_setup: bool = False, data_type_to_source_to_version: dict | None = None)
Source code in molmo_spaces/molmo_spaces_constants.py
def get_resource_manager(
    force_post_setup: bool = False, data_type_to_source_to_version: dict | None = None
):
    # Note: This would still be effective even wíthin a specific branch in the if-else below.
    # The scope of variables is defined before execution starts.
    global _RESOURCE_MANAGER

    if data_type_to_source_to_version is None:
        # save resource manager
        use_global = True
        data_type_to_source_to_version = DATA_TYPE_TO_SOURCE_TO_VERSION
    else:
        use_global = False

    if _RESOURCE_MANAGER is None or not use_global:

        def post_setup(manager: ResourceManager):
            if not os.environ.get("_IN_MULTIPROCESSING_CHILD") and str2bool(
                os.environ.get("MLSPACES_DOWNLOAD_EXTRACT_ALL_SCENES_OBJECTS_GRASPS", "False")
            ):
                # extract to cache only; link on demand (per-file for scenes)
                manager.install_all_for_data_type("scenes", skip_linking=True)
                manager.install_all_for_data_type("objects")
                manager.install_all_for_data_type("grasps")
            else:
                to_install = {}
                for scene_source in data_type_to_source_to_version["scenes"]:
                    source_packages = manager.find_all_packages_for_source("scenes", scene_source)
                    if len(source_packages) < 10:
                        # Fully install small scene datasets
                        packages = source_packages
                    else:
                        # Install unindexed scene archives
                        packages = manager.unindexed_archives("scenes", scene_source)

                    if packages:
                        to_install[scene_source] = packages

                if to_install:
                    manager.install_packages("scenes", to_install)

        # resource_manager_log_level()

        manager = setup_resource_manager(
            _select_storage(),
            symlink_dir=ASSETS_DIR,
            versions=data_type_to_source_to_version,
            cache_dir=DATA_CACHE_DIR,
            env_prefix="MLSPACES",
            post_setup=post_setup,
            force_post_setup=force_post_setup,
        )

        if use_global:
            _RESOURCE_MANAGER = manager
        else:
            return manager

    return _RESOURCE_MANAGER

get_scenes_root

get_scenes_root()
Source code in molmo_spaces/molmo_spaces_constants.py
def get_scenes_root():
    global _SCENES_ROOT
    if _SCENES_ROOT is None:
        # Ensure scenes dir under asset root exists
        get_resource_manager()

        if (ASSETS_DIR / "scenes").exists():
            _SCENES_ROOT = ASSETS_DIR / "scenes"

        else:
            _SCENES_ROOT = Path(
                os.environ.get(
                    "MLSPACES_SCENES_ROOT",
                    ASSETS_DIR / "scenes",
                )
            )
        print(f"Using SCENES_ROOT: {_SCENES_ROOT}")

    return _SCENES_ROOT

get_asset_id_to_object_type

get_asset_id_to_object_type()
Source code in molmo_spaces/molmo_spaces_constants.py
def get_asset_id_to_object_type():
    global _ASSET_ID_TO_OBJECT_TYPE
    if _ASSET_ID_TO_OBJECT_TYPE is None:
        ref_file = get_scenes_root() / "refs" / "asset_id_to_object_type.json"
        try:
            _ASSET_ID_TO_OBJECT_TYPE = compress_json.load(str(ref_file))
        except Exception as e:
            print(f"Warning: Failed to load asset_id_to_object_type.json: {e}")
            _ASSET_ID_TO_OBJECT_TYPE = {}

    return _ASSET_ID_TO_OBJECT_TYPE

get_object_type_to_asset_ids

get_object_type_to_asset_ids()
Source code in molmo_spaces/molmo_spaces_constants.py
def get_object_type_to_asset_ids():
    global _OBJECT_TYPE_TO_ASSET_IDS
    if _OBJECT_TYPE_TO_ASSET_IDS is None:
        # Group asset IDs by object type
        _OBJECT_TYPE_TO_ASSET_IDS = defaultdict(list)
        for asset_id, obj_type in get_asset_id_to_object_type().items():
            _OBJECT_TYPE_TO_ASSET_IDS[obj_type].append(asset_id)
        _OBJECT_TYPE_TO_ASSET_IDS = dict(_OBJECT_TYPE_TO_ASSET_IDS)  # Convert back to regular dict

    return _OBJECT_TYPE_TO_ASSET_IDS

get_scenes

get_scenes(dataset_name: str, split: str = 'train', return_version: bool = False) -> dict | tuple[dict, str | None]
Source code in molmo_spaces/molmo_spaces_constants.py
def get_scenes(
    dataset_name: str, split: str = "train", return_version: bool = False
) -> dict | tuple[dict, str | None]:
    names2functions = {
        "ithor": get_ithor_houses,
        "procthor-10k": get_procthor_10k_houses,
        "procthor-100k-debug": get_procthor_objaverse_houses,
        "procthor-objaverse-debug": get_procthor_objaverse_debug_houses,
        "procthor-objaverse": get_procthor_objaverse_houses,
        "holodeck-objaverse": get_holodeck_objaverse_houses,
    }
    if dataset_name not in names2functions:
        raise ValueError(
            f"dataset_name was {dataset_name}, must be one of {names2functions.keys()}"
        )
    index_map = names2functions[dataset_name](split=split)

    if not return_version:
        return index_map
    else:
        if dataset_name.startswith("procthor-10k"):
            version = DATA_TYPE_TO_SOURCE_TO_VERSION["scenes"][f"procthor-10k-{split}"]
        elif (
            dataset_name.startswith("procthor-objaverse")
            and dataset_name != "procthor-objaverse-debug"
        ):
            version = DATA_TYPE_TO_SOURCE_TO_VERSION["scenes"][f"procthor-objaverse-{split}"]
        elif dataset_name.startswith("holodeck-objaverse"):
            version = DATA_TYPE_TO_SOURCE_TO_VERSION["scenes"][f"holodeck-objaverse-{split}"]

        elif dataset_name not in DATA_TYPE_TO_SOURCE_TO_VERSION["scenes"]:
            print(f"WARNING: Missing source for {dataset_name}")
            version = None
        else:
            version = DATA_TYPE_TO_SOURCE_TO_VERSION["scenes"][dataset_name]
        return index_map, version

check_in_cache

check_in_cache(cache_key, split)
Source code in molmo_spaces/molmo_spaces_constants.py
def check_in_cache(cache_key, split):
    return cache_key in _DATASET_INDEX_CACHE and split in _DATASET_INDEX_CACHE[cache_key]

populate_cache

populate_cache(cache_key, split, index_map)
Source code in molmo_spaces/molmo_spaces_constants.py
def populate_cache(cache_key, split, index_map):
    if cache_key not in _DATASET_INDEX_CACHE:
        _DATASET_INDEX_CACHE[cache_key] = {}
    # If we got val and test (we should), add those to the cache
    for rsplit in ["train", "val", "test"]:
        num_houses = len([idx for idx in index_map[rsplit] if index_map[rsplit][idx] is not None])
        if num_houses > 0:
            _DATASET_INDEX_CACHE[cache_key][rsplit] = index_map[rsplit]

    # If no houses available for split, make sure to still set it up in the cache
    _DATASET_INDEX_CACHE[cache_key][split] = index_map[split]

get_ithor_houses

get_ithor_houses(split) -> dict

Return {split: {index: xml_path_or_None}} for iTHOR houses.

Source code in molmo_spaces/molmo_spaces_constants.py
def get_ithor_houses(split) -> dict:
    """Return {split: {index: xml_path_or_None}} for iTHOR houses."""
    cache_key = "ithor"

    if check_in_cache(cache_key, split):
        return _DATASET_INDEX_CACHE[cache_key]

    houses_dir = get_scenes_root() / "ithor"
    index_map = _build_scene_index_map_ithor(houses_dir)

    populate_cache(cache_key, split, index_map)

    return index_map

get_procthor_10k_houses

get_procthor_10k_houses(split) -> dict

Return {split: {index: xml_path_or_None}} for ProcTHOR-10k houses.

Source code in molmo_spaces/molmo_spaces_constants.py
def get_procthor_10k_houses(split) -> dict:
    """Return {split: {index: xml_path_or_None}} for ProcTHOR-10k houses."""
    cache_key = "procthor-10k"
    if split == "train":
        location = "procthor-10k-train"
    elif split == "val":
        location = "procthor-10k-val"
    elif split == "test":
        location = "procthor-10k-test"
    else:
        raise ValueError

    if check_in_cache(cache_key, split):
        return _DATASET_INDEX_CACHE[cache_key]

    houses_dir = get_scenes_root() / location
    index_map = _build_scene_index_map_procthor(houses_dir, split)

    populate_cache(cache_key, split, index_map)

    return index_map

get_procthor_objaverse_debug_houses

get_procthor_objaverse_debug_houses(split) -> dict

Return {split: {index: xml_path_or_None}} for ProcTHOR Objaverse houses.

Source code in molmo_spaces/molmo_spaces_constants.py
def get_procthor_objaverse_debug_houses(split) -> dict:
    """Return {split: {index: xml_path_or_None}} for ProcTHOR Objaverse houses."""
    cache_key = "procthor-objaverse-debug"

    if check_in_cache(cache_key, split):
        return _DATASET_INDEX_CACHE[cache_key]

    houses_dir = get_scenes_root() / "procthor-objaverse-debug"
    index_map = _build_scene_index_map_procthor(houses_dir, split)

    populate_cache(cache_key, split, index_map)

    return index_map

get_procthor_objaverse_houses

get_procthor_objaverse_houses(split) -> dict

Return {split: {index: xml_path_or_None}} for ProcTHOR Objaverse houses.

Source code in molmo_spaces/molmo_spaces_constants.py
def get_procthor_objaverse_houses(split) -> dict:
    """Return {split: {index: xml_path_or_None}} for ProcTHOR Objaverse houses."""
    cache_key = "procthor-objaverse"

    if check_in_cache(cache_key, split):
        return _DATASET_INDEX_CACHE[cache_key]

    houses_dir = get_scenes_root() / f"procthor-objaverse-{split}"
    index_map = _build_scene_index_map_procthor(houses_dir, split)

    populate_cache(cache_key, split, index_map)

    return index_map

get_holodeck_objaverse_houses

get_holodeck_objaverse_houses(split) -> dict

Return {split: {index: xml_path_or_None}} for ProcTHOR Objaverse houses.

Source code in molmo_spaces/molmo_spaces_constants.py
def get_holodeck_objaverse_houses(split) -> dict:
    """Return {split: {index: xml_path_or_None}} for ProcTHOR Objaverse houses."""
    cache_key = "holodeck-objaverse"

    if check_in_cache(cache_key, split):
        return _DATASET_INDEX_CACHE[cache_key]

    houses_dir = get_scenes_root() / f"holodeck-objaverse-{split}"
    index_map = _build_scene_index_map_procthor(houses_dir, split)

    populate_cache(cache_key, split, index_map)

    return index_map

get_robot_paths

get_robot_paths() -> dict[str, Path]

Return {robot_name: Path} for all prepackaged MlSpaces robot files.

Source code in molmo_spaces/molmo_spaces_constants.py
def get_robot_paths() -> dict[str, Path]:
    """Return {robot_name: Path} for all prepackaged MlSpaces robot files."""
    robot_paths = {}
    for robot_name in os.listdir(ROBOTS_DIR):
        robot_paths[robot_name] = ROBOTS_DIR / robot_name
    return robot_paths

install_missing_source

install_missing_source(data_type: str, missing_source: str, existing_sources: list[str])
Source code in molmo_spaces/molmo_spaces_constants.py
def install_missing_source(data_type: str, missing_source: str, existing_sources: list[str]):
    from molmospaces_resources.manager import _lock_context, LOCAL_MANIFEST_NAME
    from molmospaces_resources.setup_utils import (
        _get_current_install,
        _RESOURCE_MANAGERS,
        _manager_key,
    )

    assert missing_source in DATA_TYPE_TO_SOURCE_TO_VERSION[data_type], (
        f"{missing_source} has no version under {data_type}"
    )

    data_type_to_source_to_version = deepcopy(DATA_TYPE_TO_SOURCE_TO_VERSION)
    existing_sources = [
        source for source in existing_sources if source in data_type_to_source_to_version[data_type]
    ] + [missing_source]
    data_type_to_source_to_version[data_type] = {
        source: DATA_TYPE_TO_SOURCE_TO_VERSION[data_type][source] for source in existing_sources
    }

    current_install = _get_current_install(ASSETS_DIR, data_type_to_source_to_version)
    current_install[data_type][missing_source] = None
    manifest_path = ASSETS_DIR / LOCAL_MANIFEST_NAME
    key = _manager_key(str(_select_storage()), data_type_to_source_to_version)
    with _lock_context(ASSETS_DIR, DATA_CACHE_DIR):
        if key in _RESOURCE_MANAGERS:
            _RESOURCE_MANAGERS.pop(key)
        with open(manifest_path, "w") as f:
            json.dump(current_install, f, indent=2)

    get_resource_manager(data_type_to_source_to_version=data_type_to_source_to_version)
    assert key in _RESOURCE_MANAGERS, f"BUG: Missing expected {key} from _RESOURCE_MANAGERS"

get_robot_path

get_robot_path(robot_name) -> Path

Return the path to the prepackaged MlSpaces robot file for the given robot name.

Source code in molmo_spaces/molmo_spaces_constants.py
def get_robot_path(robot_name) -> Path:
    """
    Return the path to the prepackaged MlSpaces robot file for the given robot name.
    """
    robot_dirs = os.listdir(ROBOTS_DIR) if ROBOTS_DIR.is_dir() else []
    if robot_name not in robot_dirs or not (ROBOTS_DIR / robot_name).is_dir():
        logging.info(
            f"Robot {robot_name} not found in {ROBOTS_DIR}. Attempting direct installation."
        )
        robot_dirs = [robot_dir for robot_dir in robot_dirs if (ROBOTS_DIR / robot_dir).is_dir()]
        install_missing_source("robots", robot_name, robot_dirs)
        assert robot_name in os.listdir(ROBOTS_DIR) and (ROBOTS_DIR / robot_name).is_dir(), (
            f"Failed to install missing robot {robot_name}"
        )

    return ROBOTS_DIR / robot_name

print_license_info

print_license_info(data_type, data_source, asset_or_tar_id)
Source code in molmo_spaces/molmo_spaces_constants.py
def print_license_info(data_type, data_source, asset_or_tar_id):
    from molmo_spaces.utils.license_utils import resolve_license

    def get_identifiers():
        return [
            archive.replace(f"{data_source}_", "").replace(".tar.zst", "")
            for archive in get_resource_manager().find_all_packages_for_source(
                data_type, data_source
            )
        ]

    if asset_or_tar_id == "--list_all":
        print(f"Possible identifiers: {sorted(get_identifiers())}")
        return

    try:
        license_info = resolve_license(data_type, data_source, asset_or_tar_id)
        print(json.dumps(license_info, indent=2))
    except ValueError as e:
        import random

        archives = get_identifiers()
        formatted = "\n".join(sorted(random.choices(archives, k=min(len(archives), 10))))
        print(e)
        print(f"Possible identifiers:\n{formatted}{'...' if len(archives) > 10 else ''}")