anand004 commited on
Commit
29ed05b
·
verified ·
1 Parent(s): f8d5a0d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -166,8 +166,9 @@ def extract_data_from_pdfs(
166
  all_text += extract_only_text(reader) + "\n\n"
167
 
168
  if include_images == "Include Images":
169
- images.extend(extract_images([doc]))
170
- img_docs.append(doc.split("/")[-1])
 
171
 
172
  progress(
173
  0.6, "Generating image descriptions and inserting everything into vectorDB"
@@ -269,12 +270,6 @@ def check_validity_and_llm(session_states):
269
  raise gr.Error("Please extract data first")
270
 
271
 
272
- def get_stats(vectordb):
273
- eles = vectordb.get()
274
- # words =
275
- text_data = [f"Chunks: {len(eles)}", "HIII"]
276
- return "\n".join(text_data), "", ""
277
-
278
 
279
  with gr.Blocks(css=CSS, theme=gr.themes.Soft(text_size=sizes.text_md)) as demo:
280
  vectordb = gr.State()
 
166
  all_text += extract_only_text(reader) + "\n\n"
167
 
168
  if include_images == "Include Images":
169
+ imgs = extract_images([doc])
170
+ images.extend(imgs)
171
+ img_docs.extend([doc.split("/")[-1] for _ in range(len(imgs))])
172
 
173
  progress(
174
  0.6, "Generating image descriptions and inserting everything into vectorDB"
 
270
  raise gr.Error("Please extract data first")
271
 
272
 
 
 
 
 
 
 
273
 
274
  with gr.Blocks(css=CSS, theme=gr.themes.Soft(text_size=sizes.text_md)) as demo:
275
  vectordb = gr.State()