Spaces:
Sleeping
Sleeping
from langchain_groq import ChatGroq | |
import streamlit as st | |
from langchain.prompts import PromptTemplate | |
st.title('Plant Disease Classifier')#TITLE | |
st.subheader("HERE YOU WILL FIND CAUSES AND SOLUTION FOR YOUR PROBLEM....") | |
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 image...", type=["jpg", "jpeg", "png"]) | |
# 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 phytopathologistsr 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 solutions and reasons for that disease""") | |
if SUB: | |
D=B.format(image=uploaded_file) | |
E=LLM.invoke(D) | |
st.write(E.content) |