File size: 1,266 Bytes
c8add26 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
from langchain_groq import ChatGroq
import streamlit as st
from langchain.prompts import PromptTemplate
st.title('Gen AI_Doctor')#TITLE
st.subheader("HERE YOU WILL FIND CAUSES AND TREATMENT FOR YOUR DIEASES....")
LLM=ChatGroq(temperature=0.6,
groq_api_key='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')#GEN AI MODEL
from PIL import Image
# Create a file uploader widget
uploaded_file = st.file_uploader("Choose an Reports and Images...", type=["jpg", "jpeg", "png","PDF"," DOC/DOCX", "PDF","RTF","TXT","ODT"])
# Check if a file has been uploaded
if uploaded_file is not None:
# Open the image file
image = Image.open(uploaded_file)
# Display the image
st.image(image, caption='Uploaded Image.', use_column_width=True)
SUB=st.button('SUBMIT')#BUTTON
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) |