Download app.py from Manoj779944/AI-Health-Assistant-Basic: direct link, hf CLI and curl.
- Browser
- Download file 739 Bytes
-
https://huggingface.co/spaces/Manoj779944/AI-Health-Assistant-Basic/resolve/main/app.py
- Command line
-
hf download hf://spaces/Manoj779944/AI-Health-Assistant-Basic/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Manoj779944/AI-Health-Assistant-Basic/resolve/main/app.py
739 Bytes
| import os | |
| import subprocess | |
| # 🔹 Force install missing dependencies | |
| missing_packages = ["xgboost"] | |
| for package in missing_packages: | |
| try: | |
| __import__(package) | |
| except ImportError: | |
| subprocess.call(["pip", "install", package]) | |
| from virtualhealth import handle_user_query # Now import your function | |
| import streamlit as st | |
| st.set_page_config(page_title="AI Health Assistant", page_icon="🩺") | |
| st.title("🩺 AI Health Assistant") | |
| st.write("Ask any medical-related questions below:") | |
| # User Input | |
| user_input = st.text_input("Your Question:") | |
| # Button to Process Query | |
| if st.button("Ask"): | |
| bot_response = handle_user_query(user_input) # Call function directly | |
| st.markdown(f"**🤖 Bot:** {bot_response}") | |