ArturG9 commited on
Commit
33ab765
·
verified ·
1 Parent(s): b08d9d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -52,7 +52,7 @@ def create_retriever_from_chroma(vectorstore_path="./docs/chroma/", search_type=
52
  st.write("Vector store doesnt exist and will be created now")
53
  loader = DirectoryLoader('./data/', glob="./*.txt", loader_cls=TextLoader)
54
  docs = loader.load()
55
- st.write("Docs loaded")
56
 
57
  text_splitter = RecursiveCharacterTextSplitter.from_tiktoken_encoder(
58
  chunk_size=chunk_size, chunk_overlap=chunk_overlap,
@@ -65,7 +65,7 @@ def create_retriever_from_chroma(vectorstore_path="./docs/chroma/", search_type=
65
  vectorstore = Chroma.from_documents(
66
  documents=split_docs, embedding=embeddings, persist_directory=vectorstore_path
67
  )
68
- st.write("VectorStore is created")
69
 
70
  retriever=vectorstore.as_retriever(search_type = search_type, search_kwargs={"k": k})
71
 
@@ -91,7 +91,7 @@ def main():
91
  st.header("Chat with multiple Lithuanian Law Documents:" ":books:")
92
 
93
  st.markdown("Hi, I am Birute (Powered by qwen2-0_5b model), chat assistant, based on republic of Lithuania law documents. You can choose below information retrieval type and how many documents you want to be retrieved.")
94
- st.markdown("Available Documents: LR_Civil_Code_2022, LR_Constitution_2022, LR_Criminal_Code_2018, LR_Criminal_Procedure_code_2022,LR_Labour_code_2010. P.S it's a shame that there are no newest documents translations into English... ")
95
 
96
  if "messages" not in st.session_state:
97
  st.session_state["messages"] = [
 
52
  st.write("Vector store doesnt exist and will be created now")
53
  loader = DirectoryLoader('./data/', glob="./*.txt", loader_cls=TextLoader)
54
  docs = loader.load()
55
+
56
 
57
  text_splitter = RecursiveCharacterTextSplitter.from_tiktoken_encoder(
58
  chunk_size=chunk_size, chunk_overlap=chunk_overlap,
 
65
  vectorstore = Chroma.from_documents(
66
  documents=split_docs, embedding=embeddings, persist_directory=vectorstore_path
67
  )
68
+
69
 
70
  retriever=vectorstore.as_retriever(search_type = search_type, search_kwargs={"k": k})
71
 
 
91
  st.header("Chat with multiple Lithuanian Law Documents:" ":books:")
92
 
93
  st.markdown("Hi, I am Birute (Powered by qwen2-0_5b model), chat assistant, based on republic of Lithuania law documents. You can choose below information retrieval type and how many documents you want to be retrieved.")
94
+ st.markdown(### "Available Documents: LR_Civil_Code_2022, LR_Constitution_2022, LR_Criminal_Code_2018, LR_Criminal_Procedure_code_2022,LR_Labour_code_2010. P.S it's a shame that there are no newest documents translations into English... ")
95
 
96
  if "messages" not in st.session_state:
97
  st.session_state["messages"] = [