thechaiexperiment commited on
Commit
f9e3554
·
verified ·
1 Parent(s): 462ad54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -445,6 +445,10 @@ def generate_answer(prompt: str, tokenizer_f, model_f, max_length: int = 860, te
445
  print(f"Error generating answer: {e}")
446
  return "I apologize, but I encountered an error while generating the answer."
447
 
 
 
 
 
448
  def create_prompt(question: str, passage: str) -> str:
449
  return f"""As a medical expert, answer the following question based only on the provided passage. Be concise and direct.
450
  Passage: {passage}
 
445
  print(f"Error generating answer: {e}")
446
  return "I apologize, but I encountered an error while generating the answer."
447
 
448
+ def enhance_passage_with_entities(passage, entities):
449
+ return f"{passage}\n\nEntities: {', '.join(entities)}"
450
+
451
+
452
  def create_prompt(question: str, passage: str) -> str:
453
  return f"""As a medical expert, answer the following question based only on the provided passage. Be concise and direct.
454
  Passage: {passage}