timeki commited on
Commit
7ad11f7
·
1 Parent(s): ff74e4e

Update utils.py

Browse files
Files changed (1) hide show
  1. front/utils.py +2 -0
front/utils.py CHANGED
@@ -43,6 +43,8 @@ def process_figures(docs:list)->tuple:
43
  gallery=[]
44
  used_figures =[]
45
  figures = '<div class="figures-container"><p></p> </div>'
 
 
46
  docs_figures = [d for d in docs if d.metadata["chunk_type"] == "image"]
47
  for i, doc in enumerate(docs_figures):
48
  if doc.metadata["chunk_type"] == "image":
 
43
  gallery=[]
44
  used_figures =[]
45
  figures = '<div class="figures-container"><p></p> </div>'
46
+ if docs == []:
47
+ return figures, gallery
48
  docs_figures = [d for d in docs if d.metadata["chunk_type"] == "image"]
49
  for i, doc in enumerate(docs_figures):
50
  if doc.metadata["chunk_type"] == "image":