notabaka commited on
Commit
edbe973
1 Parent(s): ff9f02f
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -46,14 +46,14 @@ click = st.button("Search")
46
  def extract_text(doc):
47
  return textract.process(doc).decode('utf-8')
48
 
49
- return None
50
 
51
  if click and query:
52
  doc_contents = []
53
 
54
  for doc in docs:
55
  # Extract text from each document
56
- doc_text = extract_text(doc)
 
57
  doc_contents.append(doc_text)
58
 
59
  doc_embeddings = get_embeddings(doc_contents)
 
46
  def extract_text(doc):
47
  return textract.process(doc).decode('utf-8')
48
 
 
49
 
50
  if click and query:
51
  doc_contents = []
52
 
53
  for doc in docs:
54
  # Extract text from each document
55
+ doc_path = save_upload(doc)
56
+ doc_text = extract_text(doc_path)
57
  doc_contents.append(doc_text)
58
 
59
  doc_embeddings = get_embeddings(doc_contents)