twanghcmut's picture
download
raw
555 Bytes
import importlib
from typing import *
if TYPE_CHECKING:
from .v1 import MoGeModel as MoGeModelV1
from .v2 import MoGeModel as MoGeModelV2
def import_model_class_by_version(version: str) -> Type[Union['MoGeModelV1', 'MoGeModelV2']]:
assert version in ['v1', 'v2'], f'Unsupported model version: {version}'
try:
module = importlib.import_module(f'.{version}', __package__)
except ModuleNotFoundError:
raise ValueError(f'Model version "{version}" not found.')
cls = getattr(module, 'MoGeModel')
return cls

Xet Storage Details

Size:
555 Bytes
·
Xet hash:
502fa24fe0422e2f3e44ae815c6ab9df9e008a8f213a6da4f0ef71cd66eba5fa

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.