|
from langchain_groq import ChatGroq
|
|
import streamlit as st
|
|
|
|
from langchain.prompts import PromptTemplate
|
|
|
|
st.title('Gen AI_Doctor')
|
|
st.subheader("HERE YOU WILL FIND CAUSES AND TREATMENT FOR YOUR DIEASES....")
|
|
|
|
|
|
LLM=ChatGroq(temperature=0.6,
|
|
groq_api_key='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')
|
|
|
|
|
|
from PIL import Image
|
|
|
|
|
|
uploaded_file = st.file_uploader("Choose an Reports and Images...", type=["jpg", "jpeg", "png","PDF"," DOC/DOCX", "PDF","RTF","TXT","ODT"])
|
|
|
|
|
|
if uploaded_file is not None:
|
|
|
|
image = Image.open(uploaded_file)
|
|
|
|
|
|
st.image(image, caption='Uploaded Image.', use_column_width=True)
|
|
|
|
SUB=st.button('SUBMIT')
|
|
|
|
B=PromptTemplate(input=['image'],
|
|
template="""you are a doctor with 20 years of experience in this field, please go through the {image}uploaded image and classify to which it belongs and also tell me wheather it is effect to which disease and display it and also provide me the treatment and reasons for that disease""")
|
|
|
|
if SUB:
|
|
D=B.format(image=uploaded_file)
|
|
E=LLM.invoke(D)
|
|
st.write(E.content) |