Ritvik19 commited on
Commit
26f9473
·
verified ·
1 Parent(s): 4dc84dc

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -59,6 +59,8 @@ Use `/help-me` at any point of time to view this guide again.
59
 
60
 
61
  def process_documents_wrapper(inputs):
 
 
62
  snippets, documents = process_documents(inputs)
63
  st.session_state.retriever = create_retriever(snippets)
64
  st.session_state.source_doc_urls = inputs
@@ -156,7 +158,7 @@ def query_llm(inputs, relevant_docs):
156
  [
157
  f"[{ref}]"
158
  for ref in sorted(
159
- [ref.metadata["chunk_id"] for ref in relevant_docs],
160
  )
161
  ]
162
  ),
 
59
 
60
 
61
  def process_documents_wrapper(inputs):
62
+ if inputs == []:
63
+ raise InvalidArgumentError("Please provide document urls")
64
  snippets, documents = process_documents(inputs)
65
  st.session_state.retriever = create_retriever(snippets)
66
  st.session_state.source_doc_urls = inputs
 
158
  [
159
  f"[{ref}]"
160
  for ref in sorted(
161
+ [str(ref.metadata["chunk_id"]) for ref in relevant_docs],
162
  )
163
  ]
164
  ),