fffiloni commited on
Commit
ec3e3dc
1 Parent(s): 549c8fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,12 +21,12 @@ def pdf_changes(pdf_doc, repo_id):
21
 
22
  loader = OnlinePDFLoader(pdf_doc.name)
23
  documents = loader.load()
24
- text_splitter = CharacterTextSplitter(chunk_size=350, chunk_overlap=0)
25
  texts = text_splitter.split_documents(documents)
26
  embeddings = HuggingFaceHubEmbeddings()
27
  db = Chroma.from_documents(texts, embeddings)
28
  retriever = db.as_retriever()
29
- llm = HuggingFaceHub(repo_id=repo_id, model_kwargs={"temperature":0.1, "max_new_tokens":300})
30
  global qa
31
  qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever, return_source_documents=True)
32
  return "Ready"
 
21
 
22
  loader = OnlinePDFLoader(pdf_doc.name)
23
  documents = loader.load()
24
+ text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
25
  texts = text_splitter.split_documents(documents)
26
  embeddings = HuggingFaceHubEmbeddings()
27
  db = Chroma.from_documents(texts, embeddings)
28
  retriever = db.as_retriever()
29
+ llm = HuggingFaceHub(repo_id=repo_id, model_kwargs={"temperature":0.1, "max_new_tokens":250})
30
  global qa
31
  qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever, return_source_documents=True)
32
  return "Ready"