import streamlit as st from transformers import pipeline import requests from geopy.geocoders import Nominatim API_URL = "https://api-inference.huggingface.co/models/dmis-lab/biobert-base-cased-v1.1" headers = {"Authorization": "secret"} def query(payload): response = requests.post(API_URL, headers=headers, json=payload) return response.json() def main(): st.title("Healthcare Companion") st.write("This app provides healthcare guidance, prescription information, and locates nearby clinics or pharmacies.") # User input for medical question question = st.text_input("Enter your medical question:") if question: context = "General medical context." # Adjust this as needed result = query({"inputs": {"question": question, "context": context}}) st.write("**Answer:**") st.write(result.get('answer', "Sorry, I don't know the answer.")) # User input for address to find nearby clinics/pharmacies address = st.text_input("Enter your address to find nearby clinics/pharmacies:") if address: location = find_nearby_clinics(address) st.write(f"**Nearby Clinics/Pharmacies (Coordinates):** {location}") # Additional features like prescription info can be added similarly if __name__ == "__main__": main()