ubermenchh commited on
Commit
a205019
·
1 Parent(s): 7ecf05f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,12 +11,12 @@ def loading_pdf(): return 'Loading...'
11
  def pdf_changes(pdf_doc, repo_id):
12
  loader = OnlinePDFLoader(pdf_doc.name)
13
  documents = loader.load()
14
- text_splitter = CharacterTextSplitter(chunk_size=300, chunk_overlap=0)
15
  texts = text_splitter.split_documents(documents)
16
  embeddings = HuggingFaceHubEmbeddings()
17
  db = Chroma.from_documents(texts, embeddings)
18
  retriever = db.as_retriever()
19
- llm = HuggingFaceHub(repo_id=repo_id, model_kwargs={'temperature': 0.1, 'max_new_tokens': 250})
20
  global qa
21
  qa = RetrievalQA.from_chain_type(llm=llm, chain_type='stuff', retriever=retriever, return_source_documents=True)
22
  return "Ready"
 
11
  def pdf_changes(pdf_doc, repo_id):
12
  loader = OnlinePDFLoader(pdf_doc.name)
13
  documents = loader.load()
14
+ text_splitter = CharacterTextSplitter(chunk_size=1024, chunk_overlap=0)
15
  texts = text_splitter.split_documents(documents)
16
  embeddings = HuggingFaceHubEmbeddings()
17
  db = Chroma.from_documents(texts, embeddings)
18
  retriever = db.as_retriever()
19
+ llm = HuggingFaceHub(repo_id=repo_id, model_kwargs={'temperature': 0.5, 'max_new_tokens': 2096})
20
  global qa
21
  qa = RetrievalQA.from_chain_type(llm=llm, chain_type='stuff', retriever=retriever, return_source_documents=True)
22
  return "Ready"