File size: 1,263 Bytes
f0e4d3b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from dataclasses import dataclass, field
from datetime import datetime
from typing import Optional

from bson import ObjectId


@dataclass
class Model:
  language: str               # 言語区分 (例: "ja", "en")
  weight_class: str           # サイズ区分 (例: "U-5GB", "U-10GB")
  model_name: str             # 例: "fukugawa/gemma-2-9b-finetuned-bnb-4bit"
  runtime: str                # 実行環境 (例: "transformers", "llama.cpp")
  quantization: str           # 量子化方式 (例: "none", "bnb", "gptq")
  file_format: str            # 保存形式 (例: "safetensors", "gguf")
  file_size_gb: float         # ファイルサイズ(単位: GB)
  description: Optional[str] = None
  created_at: datetime = field(default_factory=datetime.utcnow)
  _id: Optional[ObjectId] = None


@dataclass
class Battle:
  language: str
  weight_class: str
  model_a_id: ObjectId
  model_b_id: ObjectId
  winner_model_id: ObjectId
  user_id: str
  vote_timestamp: datetime = field(default_factory=datetime.utcnow)
  _id: Optional[ObjectId] = None


@dataclass
class LeaderboardEntry:
  language: str
  weight_class: str
  model_id: ObjectId
  elo_score: int
  last_updated: datetime = field(default_factory=datetime.utcnow)
  _id: Optional[ObjectId] = None