Shad0ws commited on
Commit
dd67c52
1 Parent(s): 405048c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -40,7 +40,7 @@ with st.sidebar:
40
 
41
  uploaded_file = st.file_uploader(
42
  "Upload a pdf, docx, or txt file",
43
- type=["pdf", "docx", "txt", "csv"],
44
  help="Scanned documents are not supported yet!",
45
  on_change=clear_submit,
46
  )
@@ -55,11 +55,13 @@ with st.sidebar:
55
  elif uploaded_file.name.endswith(".txt"):
56
  doc = parse_txt(uploaded_file)
57
  else:
58
- st.error("File type not supported")
59
- doc = None
 
60
  text = text_to_docs(doc)
 
61
  try:
62
- with st.spinner("Indexing document... This may take a while⏳"):
63
  index = embed_docs(text)
64
  st.session_state["api_key_configured"] = True
65
  except OpenAIError as e:
 
40
 
41
  uploaded_file = st.file_uploader(
42
  "Upload a pdf, docx, or txt file",
43
+ type=["pdf", "docx", "txt", "csv", "pptx", "js", "py", "json", "html", "css", "md"],
44
  help="Scanned documents are not supported yet!",
45
  on_change=clear_submit,
46
  )
 
55
  elif uploaded_file.name.endswith(".txt"):
56
  doc = parse_txt(uploaded_file)
57
  else:
58
+ doc = parse_any(uploaded_file)
59
+ # st.error("File type not supported")
60
+ # doc = None
61
  text = text_to_docs(doc)
62
+ st.write(text)
63
  try:
64
+ with st.spinner("Indexing document..."):
65
  index = embed_docs(text)
66
  st.session_state["api_key_configured"] = True
67
  except OpenAIError as e: