Spaces:
Sleeping
Sleeping
Create config_data/config.py
Browse files- config_data/config.py +44 -0
config_data/config.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from dataclasses import dataclass
|
2 |
+
|
3 |
+
|
4 |
+
@dataclass
|
5 |
+
class TgBot:
|
6 |
+
token: str
|
7 |
+
|
8 |
+
|
9 |
+
@dataclass
|
10 |
+
class DataConfig:
|
11 |
+
dataset: str
|
12 |
+
cls_vec: str
|
13 |
+
|
14 |
+
|
15 |
+
@dataclass
|
16 |
+
class ModelConfig:
|
17 |
+
bi_checkpoint: str
|
18 |
+
cross_checkpoint: str
|
19 |
+
device: str
|
20 |
+
|
21 |
+
|
22 |
+
@dataclass
|
23 |
+
class Config:
|
24 |
+
tg_bot: TgBot
|
25 |
+
data: DataConfig
|
26 |
+
model: ModelConfig
|
27 |
+
|
28 |
+
|
29 |
+
def load_config() -> Config:
|
30 |
+
|
31 |
+
return Config(
|
32 |
+
tg_bot=TgBot(
|
33 |
+
token='BOT_TOKEN'
|
34 |
+
),
|
35 |
+
data=DataConfig(
|
36 |
+
dataset='ekaterinatao/house_md_context3',
|
37 |
+
cls_vec='ekaterinatao/house_md_cls_embeds'
|
38 |
+
),
|
39 |
+
model=ModelConfig(
|
40 |
+
bi_checkpoint='ekaterinatao/house-md-bot-bert-bi-encoder',
|
41 |
+
cross_checkpoint='ekaterinatao/house-md-bot-bert-cross-encoder',
|
42 |
+
device='cpu'
|
43 |
+
)
|
44 |
+
)
|