AeroArtz commited on
Commit
652b147
1 Parent(s): 2894a86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,10 +16,10 @@ def load_doc(pdf_doc):
16
  loader = PyMuPDFLoader(pdf_doc.name)
17
  documents = loader.load()
18
  embedding = HuggingFaceEmbeddings()
19
- text_splitter = CharacterTextSplitter(chunk_size=2000, chunk_overlap=200)
20
  text = text_splitter.split_documents(documents)
21
  db = Chroma.from_documents(text, embedding)
22
- llm = HuggingFaceHub(repo_id="OpenAssistant/oasst-sft-1-pythia-12b", model_kwargs={"temperature": 1.0, "max_length": 256})
23
  global chain
24
  chain = RetrievalQA.from_chain_type(llm=llm,chain_type="stuff",retriever=db.as_retriever())
25
  return 'Document has successfully been loaded'
 
16
  loader = PyMuPDFLoader(pdf_doc.name)
17
  documents = loader.load()
18
  embedding = HuggingFaceEmbeddings()
19
+ text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
20
  text = text_splitter.split_documents(documents)
21
  db = Chroma.from_documents(text, embedding)
22
+ llm = HuggingFaceHub(repo_id="OpenAssistant/oasst-sft-1-pythia-12b", model_kwargs={"temperature": 1.0, "max_length": 512})
23
  global chain
24
  chain = RetrievalQA.from_chain_type(llm=llm,chain_type="stuff",retriever=db.as_retriever())
25
  return 'Document has successfully been loaded'