Spaces:
Sleeping
Sleeping
from typing import Optional | |
from urllib.parse import urlparse | |
import petals | |
import pydantic | |
class ModelInfo(petals.data_structures.ModelInfo): | |
dht_prefix: Optional[str] = None | |
official: bool = True | |
limited: bool = False | |
def name(self) -> str: | |
return urlparse(self.repository).path.lstrip("/") | |
def short_name(self) -> str: | |
return self.name.split("/")[-1] | |