Spaces:
Running
Running
Create config.py
Browse files
config.py
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
# Model configuration
|
4 |
+
EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
|
5 |
+
EMBEDDING_DIM = 384
|
6 |
+
|
7 |
+
# BM25 parameters
|
8 |
+
BM25_K1 = 1.5
|
9 |
+
BM25_B = 0.75
|
10 |
+
|
11 |
+
# Search parameters
|
12 |
+
DEFAULT_TOP_K = 5
|
13 |
+
DEFAULT_VECTOR_WEIGHT = 0.6
|
14 |
+
DEFAULT_BM25_WEIGHT = 0.4
|
15 |
+
|
16 |
+
# Knowledge base files
|
17 |
+
KNOWLEDGE_BASE_FILES = [
|
18 |
+
'knowledge_base/about.md',
|
19 |
+
'knowledge_base/research_details.md',
|
20 |
+
'knowledge_base/publications_detailed.md',
|
21 |
+
'knowledge_base/skills_expertise.md',
|
22 |
+
'knowledge_base/experience_detailed.md',
|
23 |
+
'knowledge_base/statistics.md'
|
24 |
+
]
|
25 |
+
|
26 |
+
# File type mapping
|
27 |
+
FILE_TYPE_MAP = {
|
28 |
+
'about.md': ('about', 10),
|
29 |
+
'research_details.md': ('research', 9),
|
30 |
+
'publications_detailed.md': ('publications', 8),
|
31 |
+
'skills_expertise.md': ('skills', 7),
|
32 |
+
'experience_detailed.md': ('experience', 8),
|
33 |
+
'statistics.md': ('statistics', 9)
|
34 |
+
}
|
35 |
+
|
36 |
+
# Device configuration
|
37 |
+
def get_device():
|
38 |
+
import torch
|
39 |
+
return "cuda" if torch.cuda.is_available() else "cpu"
|