Spaces:
Paused
Paused
Rahul Bhoyar
commited on
Commit
•
8e9bdaf
1
Parent(s):
72c4532
Updated app.py
Browse files
app.py
CHANGED
@@ -26,11 +26,11 @@ uploaded_file = st.file_uploader("Choose a PDF file", type=["pdf"])
|
|
26 |
embed_model_uae = HuggingFaceEmbedding(model_name="WhereIsAI/UAE-Large-V1")
|
27 |
service_context = ServiceContext.from_defaults(llm=llm, chunk_size=800, chunk_overlap=20, embed_model=embed_model_uae)
|
28 |
|
29 |
-
|
30 |
-
file_contents = read_pdf(uploaded_file)
|
31 |
-
documents = Document(text=file_contents)
|
32 |
-
documents = [documents]
|
33 |
-
st.success("Documents loaded successfully!")
|
34 |
|
35 |
# Indexing the documents
|
36 |
progress_container = st.empty()
|
|
|
26 |
embed_model_uae = HuggingFaceEmbedding(model_name="WhereIsAI/UAE-Large-V1")
|
27 |
service_context = ServiceContext.from_defaults(llm=llm, chunk_size=800, chunk_overlap=20, embed_model=embed_model_uae)
|
28 |
|
29 |
+
if uploaded_file is not None:
|
30 |
+
file_contents = read_pdf(uploaded_file)
|
31 |
+
documents = Document(text=file_contents)
|
32 |
+
documents = [documents]
|
33 |
+
st.success("Documents loaded successfully!")
|
34 |
|
35 |
# Indexing the documents
|
36 |
progress_container = st.empty()
|