pminervini commited on
Commit
78b0064
1 Parent(s): 7aff13a
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -92,7 +92,7 @@ def generate(model_name: str, messages):
92
  # Define the generation_kwargs with stopping criteria
93
  generation_kwargs = {
94
  "max_new_tokens": max_new_tokens,
95
- "generation_kwargs": {"stopping_criteria": stopping_criteria},
96
  "return_full_text": False
97
  }
98
 
@@ -144,8 +144,9 @@ def rag_pipeline(prompt, index="pubmed", num_docs=3, model_name="HuggingFaceH4/z
144
 
145
  messages = [
146
  {
 
147
  "role": "system",
148
- "content": f"You are an advanced medical support assistant, designed to help clinicians by providing quick access to medical information, guidelines, and evidence-based recommendations. Alongside your built-in knowledge, you have access to a curated set of documents retrieved from trustworthy sources such as Wikipedia and PubMed. These documents include up-to-date medical guidelines, research summaries, and clinical practice information. You should use these documents as a primary source of information to ensure your responses are based on the most current and credible evidence available. Your responses should be accurate, concise, and in full compliance with medical ethics. You must always remind users that your guidance does not substitute for professional medical advice, diagnosis, or treatment. Your tone should be professional, supportive, and respectful, recognizing the complexity of healthcare decisions and the importance of personalized patient care. While you can offer information and suggestions based on the documents provided and current medical knowledge, you must emphasize the importance of clinicians' expertise and judgment in making clinical decisions. Please append a newline only when you have finished answering.\n\nRetrieved documents from {index}:\n\n{joined_docs}"
149
  }, {
150
  "role": "user",
151
  "content": prompt
 
92
  # Define the generation_kwargs with stopping criteria
93
  generation_kwargs = {
94
  "max_new_tokens": max_new_tokens,
95
+ # "stopping_criteria": stopping_criteria,
96
  "return_full_text": False
97
  }
98
 
 
144
 
145
  messages = [
146
  {
147
+ # Please append a newline only when you have finished answering.
148
  "role": "system",
149
+ "content": f"You are an advanced medical support assistant, designed to help clinicians by providing quick access to medical information, guidelines, and evidence-based recommendations. Alongside your built-in knowledge, you have access to a curated set of documents retrieved from trustworthy sources such as Wikipedia and PubMed. These documents include up-to-date medical guidelines, research summaries, and clinical practice information. You should use these documents as a primary source of information to ensure your responses are based on the most current and credible evidence available. Your responses should be accurate, concise, and in full compliance with medical ethics. You must always remind users that your guidance does not substitute for professional medical advice, diagnosis, or treatment. Your tone should be professional, supportive, and respectful, recognizing the complexity of healthcare decisions and the importance of personalized patient care. While you can offer information and suggestions based on the documents provided and current medical knowledge, you must emphasize the importance of clinicians' expertise and judgment in making clinical decisions.\n\nRetrieved documents from {index}:\n\n{joined_docs}"
150
  }, {
151
  "role": "user",
152
  "content": prompt