Spaces:
Sleeping
Sleeping
Commit ·
0e872c0
1
Parent(s): c9b8d5e
ui improved
Browse files
app.py
CHANGED
|
@@ -67,11 +67,12 @@ vectorstore = load_vectorstore()
|
|
| 67 |
qa = RetrievalQA.from_chain_type(
|
| 68 |
llm=ChatGroq(
|
| 69 |
groq_api_key=GROQ_API_KEY,
|
| 70 |
-
model_name="
|
| 71 |
temperature=0
|
| 72 |
),
|
| 73 |
retriever=vectorstore.as_retriever(search_kwargs={"k": 3}),
|
| 74 |
-
chain_type_kwargs={"prompt": PROMPT}
|
|
|
|
| 75 |
)
|
| 76 |
|
| 77 |
question = st.chat_input("Ask your medical question")
|
|
@@ -79,4 +80,7 @@ question = st.chat_input("Ask your medical question")
|
|
| 79 |
if question:
|
| 80 |
st.chat_message("user").write(question)
|
| 81 |
result = qa.invoke({"query": question})
|
|
|
|
| 82 |
st.chat_message("assistant").write(result["result"])
|
|
|
|
|
|
|
|
|
| 67 |
qa = RetrievalQA.from_chain_type(
|
| 68 |
llm=ChatGroq(
|
| 69 |
groq_api_key=GROQ_API_KEY,
|
| 70 |
+
model_name="llama-3.1-8b-instant",
|
| 71 |
temperature=0
|
| 72 |
),
|
| 73 |
retriever=vectorstore.as_retriever(search_kwargs={"k": 3}),
|
| 74 |
+
chain_type_kwargs={"prompt": PROMPT},
|
| 75 |
+
return_source_documents=True
|
| 76 |
)
|
| 77 |
|
| 78 |
question = st.chat_input("Ask your medical question")
|
|
|
|
| 80 |
if question:
|
| 81 |
st.chat_message("user").write(question)
|
| 82 |
result = qa.invoke({"query": question})
|
| 83 |
+
st.markdown("#### Answer 😎")
|
| 84 |
st.chat_message("assistant").write(result["result"])
|
| 85 |
+
st.markdown("#### Source Docs 📑")
|
| 86 |
+
st.chat_message("assistant").write(result["source_documents"])
|