ZedLow commited on
Commit
2f45ceb
·
verified ·
1 Parent(s): a615955

Update rag/config.py

Browse files
Files changed (1) hide show
  1. rag/config.py +10 -31
rag/config.py CHANGED
@@ -1,44 +1,23 @@
1
  from dataclasses import dataclass
2
- from pathlib import Path
3
 
4
  @dataclass(frozen=True)
5
  class Settings:
6
- # Data
7
- dataset_path: str = "data/dataset.json"
8
- index_dir: str = "data/index"
9
-
10
- # Router (GLiNER)
11
  router_model_id: str = "urchade/gliner_small-v2.1"
12
- router_threshold: float = 0.35 # soft threshold
13
  router_labels: tuple = ("Company", "Stock Ticker")
14
 
15
- # Retrieval model
16
  embed_model_id: str = "Alibaba-NLP/gte-Qwen2-7B-instruct"
17
- embed_max_len: int = 2048
18
- embed_batch_size: int = 1
19
 
20
- # Reranker model
21
  rerank_model_id: str = "BAAI/bge-reranker-v2-m3"
22
- rerank_max_len: int = 512
23
-
24
- # Candidate sizes
25
- top_k_retrieval: int = 15
26
- top_k_rerank: int = 4
27
- top_k_images: int = 3
28
 
29
- # Generation model
30
  gen_model_id: str = "Qwen/Qwen2-VL-2B-Instruct"
31
  max_new_tokens: int = 512
32
-
33
- # UX / Guardrails
34
- scope_companies: tuple = ("Apple", "Microsoft")
35
- enforce_not_found: bool = True
36
-
37
- def index_path(self) -> Path:
38
- return Path(self.index_dir)
39
-
40
- def doc_embeds_file(self) -> Path:
41
- return self.index_path() / "doc_embeds.pt"
42
-
43
- def doc_meta_file(self) -> Path:
44
- return self.index_path() / "doc_meta.json"
 
1
  from dataclasses import dataclass
 
2
 
3
  @dataclass(frozen=True)
4
  class Settings:
5
+ # Router
 
 
 
 
6
  router_model_id: str = "urchade/gliner_small-v2.1"
7
+ router_threshold: float = 0.3
8
  router_labels: tuple = ("Company", "Stock Ticker")
9
 
10
+ # Embedding
11
  embed_model_id: str = "Alibaba-NLP/gte-Qwen2-7B-instruct"
12
+ embed_max_length: int = 8192
13
+ embed_top_k: int = 15
14
 
15
+ # Reranker
16
  rerank_model_id: str = "BAAI/bge-reranker-v2-m3"
17
+ rerank_max_length: int = 8192
18
+ rerank_top_k: int = 4
 
 
 
 
19
 
20
+ # Vision
21
  gen_model_id: str = "Qwen/Qwen2-VL-2B-Instruct"
22
  max_new_tokens: int = 512
23
+ top_k_images: int = 4 # dans ton code: tu prends 4 puis tu affiches ce que tu as; on garde