Spaces:
Runtime error
Runtime error
Commit
·
5b094ac
1
Parent(s):
0bd5f38
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,7 +58,7 @@ if load_button:
|
|
| 58 |
|
| 59 |
#Creating embeddings instance
|
| 60 |
embeddings=create_embeddings()
|
| 61 |
-
st.session_state.vs=embeddings
|
| 62 |
st.write("Embeddings instance creation done...")
|
| 63 |
|
| 64 |
#Push data to Pinecone
|
|
@@ -88,10 +88,13 @@ if submit:
|
|
| 88 |
q = st.text_input('Ask a question about the content of your file:')
|
| 89 |
if q: # if the user entered a question and hit enter
|
| 90 |
if 'vs' in st.session_state: # if there's the vector store (user uploaded, split and embedded a file)
|
| 91 |
-
vector_store = st.session_state.vs
|
|
|
|
|
|
|
|
|
|
| 92 |
st.write(f'k: {k}')
|
| 93 |
-
answer = ask_and_get_answer(
|
| 94 |
-
|
| 95 |
# text area widget for the LLM answer
|
| 96 |
st.text_area('LLM Answer: ', value=answer)
|
| 97 |
|
|
|
|
| 58 |
|
| 59 |
#Creating embeddings instance
|
| 60 |
embeddings=create_embeddings()
|
| 61 |
+
# st.session_state.vs=embeddings
|
| 62 |
st.write("Embeddings instance creation done...")
|
| 63 |
|
| 64 |
#Push data to Pinecone
|
|
|
|
| 88 |
q = st.text_input('Ask a question about the content of your file:')
|
| 89 |
if q: # if the user entered a question and hit enter
|
| 90 |
if 'vs' in st.session_state: # if there's the vector store (user uploaded, split and embedded a file)
|
| 91 |
+
#vector_store = st.session_state.vs
|
| 92 |
+
#Creating embeddings instance
|
| 93 |
+
embeddings=create_embeddings()
|
| 94 |
+
st.write("Embeddings instance creation done...")
|
| 95 |
st.write(f'k: {k}')
|
| 96 |
+
answer = ask_and_get_answer(embeddings, q, k)
|
| 97 |
+
|
| 98 |
# text area widget for the LLM answer
|
| 99 |
st.text_area('LLM Answer: ', value=answer)
|
| 100 |
|