degbu embeddings
Browse files
app.py
CHANGED
|
@@ -143,8 +143,8 @@ with col1:
|
|
| 143 |
|
| 144 |
st.divider()
|
| 145 |
|
| 146 |
-
|
| 147 |
-
|
| 148 |
|
| 149 |
prompt_txt = 'Summarize this document in a 3-5 sentences.'
|
| 150 |
prompt = st.text_area(
|
|
@@ -153,8 +153,8 @@ with col1:
|
|
| 153 |
value=prompt_txt
|
| 154 |
)
|
| 155 |
|
| 156 |
-
|
| 157 |
-
|
| 158 |
|
| 159 |
with col2:
|
| 160 |
tab1, tab2 = st.tabs(["Uploaded File", "Parsed File",])
|
|
|
|
| 143 |
|
| 144 |
st.divider()
|
| 145 |
|
| 146 |
+
index = VectorStoreIndex.from_documents(parsed_document)
|
| 147 |
+
query_engine = index.as_query_engine()
|
| 148 |
|
| 149 |
prompt_txt = 'Summarize this document in a 3-5 sentences.'
|
| 150 |
prompt = st.text_area(
|
|
|
|
| 153 |
value=prompt_txt
|
| 154 |
)
|
| 155 |
|
| 156 |
+
response = qa_engine.query(prompt)
|
| 157 |
+
st.write(response.response)
|
| 158 |
|
| 159 |
with col2:
|
| 160 |
tab1, tab2 = st.tabs(["Uploaded File", "Parsed File",])
|