Spaces:
Runtime error
Runtime error
import re | |
import requests | |
from enum import Enum | |
from dataclasses import dataclass | |
class ModelInfo: | |
name: str | |
symbol: str # emoji | |
class ModelType(Enum): | |
PT = ModelInfo(name="pretrained", symbol="π’") | |
FT = ModelInfo(name="fine-tuned", symbol="πΆ") | |
IFT = ModelInfo(name="instruction-tuned", symbol="β") | |
RL = ModelInfo(name="RL-tuned", symbol="π¦") | |
Unknown = ModelInfo(name="Unknown, add type to request file!", symbol="β") | |
def to_str(self, separator=" "): | |
return f"{self.value.symbol}{separator}{self.value.name}" | |
text = requests.get( | |
"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard/raw/main/src/display_models/model_metadata_type.py" | |
).text | |
dicts = re.findall(r"\{.*?\}", text, re.DOTALL) | |
MODEL_TYPES = eval(max(dicts, key=len)) | |
MODEL_TYPES | |