-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
66 lines (56 loc) · 1.84 KB
/
Copy pathconfig.py
File metadata and controls
66 lines (56 loc) · 1.84 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import os
from pathlib import Path
# Get the current directory
BASE_DIR = Path(__file__).parent.absolute()
class Config:
# Data paths (relative to project directory)
DATA_DIR = BASE_DIR / "data"
VECTORSTORE_DIR = BASE_DIR / "vectorstore"
MODELS_DIR = BASE_DIR / "models"
# Ensure directories exist
DATA_DIR.mkdir(exist_ok=True)
VECTORSTORE_DIR.mkdir(exist_ok=True)
MODELS_DIR.mkdir(exist_ok=True)
# Model configurations
EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
# Free LLM options (choose one)
LLM_PROVIDERS = {
"flan_t5_small": {
"model_name": "google/flan-t5-small",
"task": "text2text-generation",
"max_new_tokens": 256,
"temperature": 0.3,
"do_sample": True
},
"flan_t5_base": {
"model_name": "google/flan-t5-base",
"task": "text2text-generation",
"max_new_tokens": 512,
"temperature": 0.3,
"do_sample": True
},
"local_llm": {
"model_name": "microsoft/DialoGPT-small", # Fallback option
"task": "text-generation",
"max_new_tokens": 128,
"temperature": 0.6,
"do_sample": True
},
"simple_qa": {
"model_name": "distilbert-base-uncased-distilled-squad",
"task": "question-answering",
"max_new_tokens": 256,
"temperature": 0.3
}
}
# Default LLM provider (FLAN-T5 is better for instruction following)
DEFAULT_LLM_PROVIDER = "flan_t5_small"
# Text processing
CHUNK_SIZE = 500
CHUNK_OVERLAP = 50
# Retrieval settings
RETRIEVAL_K = 3 # Number of documents to retrieve
# Flask settings
FLASK_HOST = "0.0.0.0"
FLASK_PORT = 8080
FLASK_DEBUG = True