Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,9 +20,6 @@ from dotenv import load_dotenv
|
|
20 |
from langchain_text_splitters import CharacterTextSplitter
|
21 |
from functions import fn_rebuild_vector_store
|
22 |
|
23 |
-
# executando fn para veirficacao True/False de criação de vector store
|
24 |
-
fn_rebuild_vector_store()
|
25 |
-
|
26 |
logging.getLogger("langchain.text_splitter").setLevel(logging.ERROR)
|
27 |
warnings.filterwarnings("ignore")
|
28 |
logging.basicConfig(format="%(asctime)s | %(levelname)s | %(message)s", level=logging.INFO)
|
@@ -46,9 +43,14 @@ CHUNK_SIZE = config.get('CHUNK_SIZE', 500)
|
|
46 |
CHUNK_OVERLAP = config.get('CHUNK_OVERLAP', 50)
|
47 |
CACHE_FOLDER = config.get('CACHE_FOLDER', './cache')
|
48 |
URL_LIST = config.get('URL_LIST', [])
|
49 |
-
VS_BASE = config.get('VS_BASE', './
|
50 |
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
52 |
def get_llm():
|
53 |
logger.info(f"Carregando modelo do HuggingFace: {LLM_MODEL}")
|
54 |
tokenizer = AutoTokenizer.from_pretrained(
|
|
|
20 |
from langchain_text_splitters import CharacterTextSplitter
|
21 |
from functions import fn_rebuild_vector_store
|
22 |
|
|
|
|
|
|
|
23 |
logging.getLogger("langchain.text_splitter").setLevel(logging.ERROR)
|
24 |
warnings.filterwarnings("ignore")
|
25 |
logging.basicConfig(format="%(asctime)s | %(levelname)s | %(message)s", level=logging.INFO)
|
|
|
43 |
CHUNK_OVERLAP = config.get('CHUNK_OVERLAP', 50)
|
44 |
CACHE_FOLDER = config.get('CACHE_FOLDER', './cache')
|
45 |
URL_LIST = config.get('URL_LIST', [])
|
46 |
+
VS_BASE = config.get('VS_BASE', './vs')
|
47 |
|
48 |
+
|
49 |
+
# ----------- VECTOR STORE CREATION -----------
|
50 |
+
# executando fn para veirficacao True/False de criação de vector store
|
51 |
+
fn_rebuild_vector_store(REBUILD_VECTOR_STORE, URL_LIST, VS_BASE, EMBEDDING_MODEL, CACHE_FOLDER, CHUNK_SIZE, CHUNK_OVERLAP)
|
52 |
+
|
53 |
+
# ----------- SWARM -----------
|
54 |
def get_llm():
|
55 |
logger.info(f"Carregando modelo do HuggingFace: {LLM_MODEL}")
|
56 |
tokenizer = AutoTokenizer.from_pretrained(
|