Spaces:
Running
Running
import os | |
# Model configuration | |
EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2" | |
EMBEDDING_DIM = 384 | |
# BM25 parameters | |
BM25_K1 = 1.5 | |
BM25_B = 0.75 | |
# Search parameters | |
DEFAULT_TOP_K = 5 | |
DEFAULT_VECTOR_WEIGHT = 0.6 | |
DEFAULT_BM25_WEIGHT = 0.4 | |
# Knowledge base files | |
KNOWLEDGE_BASE_FILES = [ | |
'knowledge_base/about.md', | |
'knowledge_base/research_details.md', | |
'knowledge_base/publications_detailed.md', | |
'knowledge_base/skills_expertise.md', | |
'knowledge_base/experience_detailed.md', | |
'knowledge_base/statistics.md' | |
] | |
# File type mapping | |
FILE_TYPE_MAP = { | |
'about.md': ('about', 10), | |
'research_details.md': ('research', 9), | |
'publications_detailed.md': ('publications', 8), | |
'skills_expertise.md': ('skills', 7), | |
'experience_detailed.md': ('experience', 8), | |
'statistics.md': ('statistics', 9) | |
} | |
# Device configuration | |
def get_device(): | |
import torch | |
return "cuda" if torch.cuda.is_available() else "cpu" |