Bullet500 commited on
Commit
4f25d65
·
verified ·
1 Parent(s): 5dce8db

Upload AI_skin doctor.py

Browse files
Files changed (1) hide show
  1. AI_skin doctor.py +35 -0
AI_skin doctor.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain_groq import ChatGroq
2
+ import streamlit as st
3
+
4
+ from langchain.prompts import PromptTemplate
5
+
6
+ st.title('Plant Disease Classifier')#TITLE
7
+ st.subheader("HERE YOU WILL FIND CAUSES AND SOLUTION FOR YOUR PROBLEM....")
8
+
9
+
10
+ LLM=ChatGroq(temperature=0.6,
11
+ groq_api_key='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')#GEN AI MODEL
12
+
13
+
14
+ from PIL import Image
15
+
16
+ # Create a file uploader widget
17
+ uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
18
+
19
+ # Check if a file has been uploaded
20
+ if uploaded_file is not None:
21
+ # Open the image file
22
+ image = Image.open(uploaded_file)
23
+
24
+ # Display the image
25
+ st.image(image, caption='Uploaded Image.', use_column_width=True)
26
+
27
+ SUB=st.button('SUBMIT')#BUTTON
28
+
29
+ B=PromptTemplate(input=['image'],
30
+ 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""")
31
+
32
+ if SUB:
33
+ D=B.format(image=uploaded_file)
34
+ E=LLM.invoke(D)
35
+ st.write(E.content)