Skincare-by-Dr-Aisha-Ghias commited on
Commit
f2f6fcf
1 Parent(s): 41c14df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -27,7 +27,7 @@ st.markdown(custom_css, unsafe_allow_html=True)
27
 
28
  # Initialize session state if it doesn't exist
29
  if "messages" not in st.session_state:
30
- st.session_state["messages"] = [{"role": "assistant", "content": "How can I assist you in dermatology?"}]
31
 
32
  # Define the model query function with error handling for HuggingFace
33
  def query_model(image_data):
@@ -36,7 +36,7 @@ def query_model(image_data):
36
  response.raise_for_status()
37
  return response.json()
38
  except requests.RequestException as e:
39
- st.error(f"Error querying the model: Setting Up The Server Please Try Again in 10 Seconds")
40
  return None
41
 
42
  # Main
@@ -81,7 +81,7 @@ if uploaded_file:
81
  st.chat_message("user").write(user_input)
82
 
83
  # Prepare complete message to send to OpenAI
84
- complete_message = f"This is what we discussed before: {stringi}. The result for the uploaded image is: {results}. This is the new question: {user_input}. [IF SOMEONE IS SPECIFICALLY ASKING ABOUT THIS PROJECT OR CANCER DETECTION AI ONLY THEN MENTION SOMETHING LIKE THIS, Dr. Aisha Zargham led a team of experts, combining her rich medical knowledge with advances in artificial intelligence to create this game-changing skin cancer detection system.] [YOU ARE NOT TALKING WITH PATIENTS, YOU ARE TALKING WITH DOCOTRS WHO ARE DIAGNOSING PATIENTS] [REMEMER YOUR AUDIENCE IS DERMATOLOGIST, MEDICAL STUDENTS, DOCTORS, PLEASE ENGAGE AND HELP THEM IN RESEARCHING ON IMAGE RESULTS] [KEEP YOUR ANSWER SHORTER] [IN THE DISEASES FOCUS MAINLY THE DISEASE WITH THE HIGHEST SCORE IN RESULTS]"
85
  conversation_messages = [{"role": "system", "content": "You are a expert dermatologist on a website where we analyze images through Ai for Skin Cancer."},
86
  {"role": "user", "content": complete_message}]
87
 
 
27
 
28
  # Initialize session state if it doesn't exist
29
  if "messages" not in st.session_state:
30
+ st.session_state["messages"] = [{"role": "This AI model is designed to classify skin images into specific categories: Actinic Keratoses (akiec), Basal Cell Carcinoma (bcc), Benign Keratosis (bkl), Dermatofibroma (df), Melanoma (mel), Melanocytic Nevi (nv), and Vascular Lesions (vasc). It won't recognize general skin images. Ask More?"}]
31
 
32
  # Define the model query function with error handling for HuggingFace
33
  def query_model(image_data):
 
36
  response.raise_for_status()
37
  return response.json()
38
  except requests.RequestException as e:
39
+ st.error(f"Error querying the model: Setting Up The Server Please Try Again in 5 Seconds")
40
  return None
41
 
42
  # Main
 
81
  st.chat_message("user").write(user_input)
82
 
83
  # Prepare complete message to send to OpenAI
84
+ complete_message = f"This is what we discussed before: {stringi}. The result for the uploaded image is: {results}. This is the new question: {user_input}. [IF SOMEONE IS SPECIFICALLY ASKING ABOUT THIS PROJECT OR CANCER DETECTION AI ONLY THEN MENTION SOMETHING LIKE THIS, Dr. Aisha Zargham led a team of experts, combining her rich medical knowledge with advances in artificial intelligence to create this game-changing skin cancer detection system.] [YOU ARE NOT TALKING WITH PATIENTS, YOU ARE TALKING WITH DOCOTRS WHO ARE DIAGNOSING PATIENTS] [REMEMER YOUR AUDIENCE IS DERMATOLOGIST, MEDICAL STUDENTS, DOCTORS, PLEASE ENGAGE AND HELP THEM IN RESEARCHING ON IMAGE RESULTS] [KEEP YOUR ANSWER SHORTER] [KEEP YOUR MESSAGE SHORT] [IN THE DISEASES FOCUS MAINLY THE DISEASE WITH THE HIGHEST SCORE IN RESULTS]"
85
  conversation_messages = [{"role": "system", "content": "You are a expert dermatologist on a website where we analyze images through Ai for Skin Cancer."},
86
  {"role": "user", "content": complete_message}]
87