-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.py
114 lines (85 loc) · 2.42 KB
/
config.py
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
"""
File name: config.py
Author: Luigi Saetta
Date created: 2023-12-15
Date last modified: 2024-03-16
Python Version: 3.11
Description:
This module provides some configurations
Usage:
Import this module into other scripts to use its functions.
Example:
...
License:
This code is released under the MIT License.
Notes:
This is a part of a set of demo showing how to use Oracle Vector DB,
OCI GenAI service, Oracle GenAI Embeddings, to build a RAG solution,
where all he data (text + embeddings) are stored in Oracle DB 23c
Warnings:
This module is in development, may change in future versions.
"""
VERBOSE = False
DIR_BOOKS = "./books"
STREAM_CHAT = True
# the ony one for now
EMBED_MODEL_TYPE = "OCI"
# Cohere embeddings model in OCI
# for multilingual (es: italian) use this one
EMBED_MODEL = "cohere.embed-multilingual-v3.0"
# used for token counting
# should be changed accordingly to model for LLM
TOKENIZER = "CohereForAI/c4ai-command-r-v01"
# to enable splitting pages in chunks
# in token
# modified 05/02/2024
ENABLE_CHUNKING = True
MAX_CHUNK_SIZE = 1600
CHUNK_OVERLAP = 100
# choose the Gen Model
GEN_MODEL = "OCI"
OCI_GEN_MODEL = "cohere.command-r-16k"
# OCI_GEN_MODEL = "cohere.command-r-plus"
# OCI_GEN_MODEL = "meta.llama-3-70b-instruct"
# GEN_MODEL = "MISTRAL"
# for command-r in Cohere API
# GEN_MODEL = "COHERE"
# for Cohere in vLLM
# GEN_MODEL = "VLLM"
# for retrieval
TOP_K = 16
# reranker
TOP_N = 8
# for GenAI models
MAX_TOKENS = 1024
# added 29/02
TEMPERATURE = 0.1
# if we want to add a reranker (Cohere or BAAI for now)
ADD_RERANKER = True
RERANKER_MODEL = "COHERE"
# RERANKER_MODEL = "OCI_BAAI"
RERANKER_ID = "ocid1.datasciencemodeldeployment.oc1.eu-frankfurt-1.amaaaaaangencdyaulxbosgii6yajt2jdsrrvfbequkxt3mepz675uk3ui3q"
# for chat engine
CHAT_MODE = "condense_plus_context"
# cambiato per Cohere command-R
MEMORY_TOKEN_LIMIT = 10000
# bits used to store embeddings
# possible values: 32 or 64
# must be aligned with the create_tables.sql used
EMBEDDINGS_BITS = 64
# ID generation: LLINDEX, HASH, BOOK_PAGE_NUM
# define the method to generate ID
ID_GEN_METHOD = "HASH"
# Tracing
ADD_PHX_TRACING = True
PHX_PORT = "7777"
PHX_HOST = "0.0.0.0"
# To enable approximate query
# disable if you're using AI vector Search LA1 or you
# have not create indexes on vector table
LA2_ENABLE_INDEX = False
# UI
ADD_REFERENCES = True
# logging
# doesn't work the count
SHOW_COUNT_TOKENS = False