Spaces:
Build error
Build error
Chandranshu Jain
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,10 +70,11 @@ def get_conversational_chain():
|
|
| 70 |
def embedding(chunk,query):
|
| 71 |
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
| 72 |
db = Chroma.from_documents(chunk,embeddings)
|
| 73 |
-
|
| 74 |
print(docs)
|
| 75 |
chain = get_conversational_chain()
|
| 76 |
-
response = chain({"input_documents":
|
|
|
|
| 77 |
st.write("Reply: ", response["output_text"])
|
| 78 |
|
| 79 |
|
|
|
|
| 70 |
def embedding(chunk,query):
|
| 71 |
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
| 72 |
db = Chroma.from_documents(chunk,embeddings)
|
| 73 |
+
doc = db.similarity_search(query)
|
| 74 |
print(docs)
|
| 75 |
chain = get_conversational_chain()
|
| 76 |
+
response = chain({"input_documents": doc, "question": query}, return_only_outputs=True)
|
| 77 |
+
print(response)
|
| 78 |
st.write("Reply: ", response["output_text"])
|
| 79 |
|
| 80 |
|