Spaces:
Runtime error
Runtime error
adarsh
commited on
Commit
·
97131a6
1
Parent(s):
c884422
upate footer
Browse files- .gitignore +1 -0
- app.py +16 -13
.gitignore
CHANGED
|
@@ -3,3 +3,4 @@ myenv/
|
|
| 3 |
models/
|
| 4 |
tempCodeRunnerFile.py
|
| 5 |
__pycache__/
|
|
|
|
|
|
| 3 |
models/
|
| 4 |
tempCodeRunnerFile.py
|
| 5 |
__pycache__/
|
| 6 |
+
check.py
|
app.py
CHANGED
|
@@ -207,16 +207,19 @@ st.markdown("""
|
|
| 207 |
left: 0;
|
| 208 |
bottom: 0;
|
| 209 |
width: 100%;
|
| 210 |
-
background-color: #
|
| 211 |
-
color:
|
| 212 |
text-align: center;
|
| 213 |
-
|
| 214 |
}
|
| 215 |
.social-icons a {
|
| 216 |
-
color:
|
| 217 |
margin: 0 10px;
|
| 218 |
font-size: 24px;
|
| 219 |
}
|
|
|
|
|
|
|
|
|
|
| 220 |
</style>
|
| 221 |
""", unsafe_allow_html=True)
|
| 222 |
|
|
@@ -229,7 +232,8 @@ st.title("🏥 Medicure RAG Chatbot")
|
|
| 229 |
|
| 230 |
# Display welcome message
|
| 231 |
st.write("Welcome to Medicure Chatbot! Ask any medical question and I'll do my best to help you.")
|
| 232 |
-
st.write("#### Built with 🤗 Ctransformers, Langchain, and Pinecone. Powered by Metal-llama2-7b-chat quantized LLM")
|
|
|
|
| 233 |
|
| 234 |
# Parameters section
|
| 235 |
st.sidebar.header("Parameters")
|
|
@@ -268,22 +272,21 @@ qa = initialize_chatbot(k_value, max_new_tokens, temperature)
|
|
| 268 |
user_input = st.text_input("Ask your question:")
|
| 269 |
if st.button("Send", key="send"):
|
| 270 |
if user_input:
|
| 271 |
-
# Create a
|
| 272 |
-
|
|
|
|
| 273 |
|
| 274 |
-
# Simulate progress with tqdm
|
| 275 |
total_steps = 100
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
pbar.update(1)
|
| 280 |
|
| 281 |
# Get the actual response
|
| 282 |
result = qa({"query": user_input})
|
| 283 |
response = result["result"]
|
| 284 |
|
| 285 |
# Clear the progress bar
|
| 286 |
-
|
| 287 |
|
| 288 |
st.session_state.chat_history.append(("You", user_input))
|
| 289 |
st.session_state.chat_history.append(("Bot", response))
|
|
|
|
| 207 |
left: 0;
|
| 208 |
bottom: 0;
|
| 209 |
width: 100%;
|
| 210 |
+
background-color: #f0f8ff ;
|
| 211 |
+
color: #333;
|
| 212 |
text-align: center;
|
| 213 |
+
|
| 214 |
}
|
| 215 |
.social-icons a {
|
| 216 |
+
color: #333;
|
| 217 |
margin: 0 10px;
|
| 218 |
font-size: 24px;
|
| 219 |
}
|
| 220 |
+
.social-icons a>social-icons a:hover {
|
| 221 |
+
color: #4CAF50;
|
| 222 |
+
}
|
| 223 |
</style>
|
| 224 |
""", unsafe_allow_html=True)
|
| 225 |
|
|
|
|
| 232 |
|
| 233 |
# Display welcome message
|
| 234 |
st.write("Welcome to Medicure Chatbot! Ask any medical question and I'll do my best to help you.")
|
| 235 |
+
st.write("#### Built with 🤗 Ctransformers, Langchain, and Pinecone VectorDB. Powered by Metal-llama2-7b-chat quantized LLM")
|
| 236 |
+
st.write("##### Resource Used 📖 : The Gale Encyclopedia of Medicine ")
|
| 237 |
|
| 238 |
# Parameters section
|
| 239 |
st.sidebar.header("Parameters")
|
|
|
|
| 272 |
user_input = st.text_input("Ask your question:")
|
| 273 |
if st.button("Send", key="send"):
|
| 274 |
if user_input:
|
| 275 |
+
# Create a progress bar
|
| 276 |
+
progress_bar = st.progress(0)
|
| 277 |
+
|
| 278 |
|
|
|
|
| 279 |
total_steps = 100
|
| 280 |
+
for i in range(total_steps):
|
| 281 |
+
time.sleep(0.05)
|
| 282 |
+
progress_bar.progress((i + 1) / total_steps)
|
|
|
|
| 283 |
|
| 284 |
# Get the actual response
|
| 285 |
result = qa({"query": user_input})
|
| 286 |
response = result["result"]
|
| 287 |
|
| 288 |
# Clear the progress bar
|
| 289 |
+
progress_bar.empty()
|
| 290 |
|
| 291 |
st.session_state.chat_history.append(("You", user_input))
|
| 292 |
st.session_state.chat_history.append(("Bot", response))
|