-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
37 lines (27 loc) · 1014 Bytes
/
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
import configparser
class Config:
def __init__(self, config='qa.conf'):
self.config = configparser.ConfigParser()
self.config.read(config)
def get_max_length(self):
return int(self.config['embedding']['max_length'])
def get_embedding_type(self):
return self.config['embedding']['type']
def get_embedding_model(self):
return self.config['embedding']['model']
def get_llm_model(self):
return self.config['llm']['model']
def get_vector_store(self):
return self.config['store']['vector_db']
def get_content_store(self):
return self.config['store']['content_db']
def get_open_api_key(self):
return self.config['openai']['api_key']
def get_glm_local_cache(self):
return self.config['glm']['local_cache']
def get_web_port(self):
port_str = self.config['web']['port']
if port_str:
return int(port_str)
else:
return 6006