api_for_unity / data_structures.py
ldhldh's picture
Upload 8 files
90e26fa
raw
history blame
455 Bytes
from typing import Optional
from urllib.parse import urlparse
import petals
import pydantic
@pydantic.dataclasses.dataclass
class ModelInfo(petals.data_structures.ModelInfo):
dht_prefix: Optional[str] = None
official: bool = True
limited: bool = False
@property
def name(self) -> str:
return urlparse(self.repository).path.lstrip("/")
@property
def short_name(self) -> str:
return self.name.split("/")[-1]