degbu embeddings
Browse files
app.py
CHANGED
@@ -137,9 +137,6 @@ def main():
|
|
137 |
|
138 |
st.divider()
|
139 |
|
140 |
-
index = VectorStoreIndex.from_documents(parsed_document)
|
141 |
-
query_engine = index.as_query_engine()
|
142 |
-
|
143 |
prompt_txt = 'Summarize this document in a 3-5 sentences.'
|
144 |
prompt = st.text_area(
|
145 |
label="Enter you query.",
|
@@ -147,8 +144,11 @@ def main():
|
|
147 |
value=prompt_txt
|
148 |
)
|
149 |
|
150 |
-
|
151 |
-
|
|
|
|
|
|
|
152 |
|
153 |
with col2:
|
154 |
tab1, tab2 = st.tabs(["Uploaded File", "Parsed File",])
|
|
|
137 |
|
138 |
st.divider()
|
139 |
|
|
|
|
|
|
|
140 |
prompt_txt = 'Summarize this document in a 3-5 sentences.'
|
141 |
prompt = st.text_area(
|
142 |
label="Enter you query.",
|
|
|
144 |
value=prompt_txt
|
145 |
)
|
146 |
|
147 |
+
if parsed_document is not None:
|
148 |
+
index = VectorStoreIndex.from_documents(parsed_document)
|
149 |
+
query_engine = index.as_query_engine()
|
150 |
+
response = query_engine.query(prompt)
|
151 |
+
st.write(response.response)
|
152 |
|
153 |
with col2:
|
154 |
tab1, tab2 = st.tabs(["Uploaded File", "Parsed File",])
|