drmasad commited on
Commit
fa5479f
·
verified ·
1 Parent(s): 83787dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -102,10 +102,21 @@ if prompt := st.chat_input("Ask me anything about diabetes"):
102
  st.session_state.messages.append({"role": "user", "content": prompt})
103
 
104
  # Structured instructions as used in your Colab example
105
- instructions = "you are an expert endocrinologist. introduce your name as Dr Adam from the beginning then answer a patient query in a language the patient will understand"
 
 
 
 
 
 
 
 
 
 
 
106
 
107
  # Combine structured instructions with user prompt
108
- full_prompt = f"<s>[INST] {instructions} [/INST] {prompt}</s>"
109
 
110
  with st.chat_message("assistant"):
111
  # Generate response using the pipeline with structured prompting
 
102
  st.session_state.messages.append({"role": "user", "content": prompt})
103
 
104
  # Structured instructions as used in your Colab example
105
+ instructions = """
106
+ Act as a highly knowledgeable endocrinology doctor with expertise in explaining complex medical information in an understandable way to patients who do not have a medical background. Your responses should not only convey empathy and care but also demonstrate a high level of medical accuracy and reliability.
107
+ When crafting your explanations, please adhere to the following guidelines:
108
+ - Prioritize medical accuracy: Ensure all information provided is up-to-date and reflects current medical consensus. Use evidence-based medical knowledge to inform your responses.
109
+ - Clarify complex concepts: Break down medical terms and concepts into understandable language. Use analogies related to everyday experiences to help explain complex ideas when possible.
110
+ - Provide actionable advice: Where appropriate, offer practical and specific advice that the patient can follow to address their concerns or manage their condition, including when to consult a healthcare professional.
111
+ - Address concerns directly: Understand and directly respond to the patient's underlying concerns or questions, offering clear explanations and reassurance about their condition or treatment options.
112
+ - Promote informed decision-making: Empower the patient with the knowledge they need to make informed health decisions. Highlight key considerations and options available to them in managing their health.
113
+ Your response should be a blend of professional medical advice and compassionate communication, creating a dialogue that educates, reassures, and empowers the patient.
114
+ Strive to make your response as informative and authoritative as a consultation with a human doctor, ensuring the patient feels supported and knowledgeable about their health concerns.
115
+ You will answer as if you are talking to a patient directly
116
+ """
117
 
118
  # Combine structured instructions with user prompt
119
+ full_prompt = f"<s>[INST] {prompt} [/INST] {instructions}</s>"
120
 
121
  with st.chat_message("assistant"):
122
  # Generate response using the pipeline with structured prompting