MatteoScript commited on
Commit
7b794d2
1 Parent(s): d323e09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -20,7 +20,7 @@ import torch
20
  import tqdm
21
  import accelerate
22
 
23
- default_persist_directory = '/ChromaDB'
24
 
25
  llm_name0 = "mistralai/Mixtral-8x7B-Instruct-v0.1"
26
 
@@ -55,9 +55,7 @@ def create_db(splits, collection_name):
55
  # Load vector database
56
  def load_db():
57
  embedding = HuggingFaceEmbeddings(model_name="sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2")
58
- vectordb = Chroma(
59
- # persist_directory=default_persist_directory,
60
- embedding_function=embedding)
61
  return vectordb
62
 
63
 
@@ -110,7 +108,8 @@ def initialize_database(list_file_obj, chunk_size, chunk_overlap, progress=gr.Pr
110
  # Create or load Vector database
111
  progress(0.5, desc="Generating vector database...")
112
  # global vector_db
113
- vector_db = create_db(doc_splits, collection_name)
 
114
  progress(0.9, desc="Done!")
115
  return vector_db, collection_name, "Complete!"
116
 
 
20
  import tqdm
21
  import accelerate
22
 
23
+ default_persist_directory = './ChromaDB'
24
 
25
  llm_name0 = "mistralai/Mixtral-8x7B-Instruct-v0.1"
26
 
 
55
  # Load vector database
56
  def load_db():
57
  embedding = HuggingFaceEmbeddings(model_name="sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2")
58
+ vectordb = Chroma(persist_directory=default_persist_directory, embedding_function=embedding)
 
 
59
  return vectordb
60
 
61
 
 
108
  # Create or load Vector database
109
  progress(0.5, desc="Generating vector database...")
110
  # global vector_db
111
+ #vector_db = create_db(doc_splits, collection_name)
112
+ vector_db = load_db()
113
  progress(0.9, desc="Done!")
114
  return vector_db, collection_name, "Complete!"
115