keppy commited on
Commit
7c72a7b
β€’
1 Parent(s): bee703c

change prompt and ui

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -39,10 +39,8 @@ terminators = [
39
  tokenizer.convert_tokens_to_ids("<|eot_id|>")
40
  ]
41
 
42
- SYS_PROMPT = """You are an assistant for answering questions.
43
- You are given the extracted parts of a long document and a question. Provide a conversational answer.
44
- If you don't know the answer, just say "I do not know." Don't make up an answer."""
45
-
46
 
47
 
48
  def search(query: str, k: int = 3 ):
@@ -124,9 +122,13 @@ HPP Chatbot
124
  """
125
  with gr.Blocks() as demo:
126
  with gr.Row():
127
- prompt_input = gr.Textbox(label="Enter your prompt")
 
 
 
 
128
  submit_button = gr.Button("Submit")
129
- chat_output = gr.Textbox(label="Chat Response", lines=5)
130
  filename = gr.Textbox(label="File Name", lines=1)
131
  file_display = gr.Textbox(label="File Content", lines=10)
132
 
@@ -142,4 +144,4 @@ with gr.Blocks() as demo:
142
  outputs=file_display
143
  )
144
  if __name__ == "__main__":
145
- demo.launch(debug=True, share=True)
 
39
  tokenizer.convert_tokens_to_ids("<|eot_id|>")
40
  ]
41
 
42
+ SYS_PROMPT = """You are an expert biomedical researcher. For answering the Question at the end with brevity, you need to first read the Context provided. Then give your final answer briefly, by citing the Provenance information from the context. You can find Provenance from the Context statement 'Provenance of this association is <Provenance>'. Do not forget to cite the Provenance information. Note that, if Provenance is 'GWAS' report it as 'GWAS Catalog'. If Provenance is 'DISEASES' report it
43
+ as 'DISEASES database - https://diseases.jensenlab.org'. Additionally, when providing drug or medication suggestions, give maximum information available and then advise the user to seek guidance from a healthcare professional as a precautionary measure."""
 
 
44
 
45
 
46
  def search(query: str, k: int = 3 ):
 
122
  """
123
  with gr.Blocks() as demo:
124
  with gr.Row():
125
+ prompt_input = gr.Textbox(
126
+ label="Enter your prompt",
127
+ value="What are the current challenges in developing effective gene therapy for hypophosphatasia?",
128
+ lines=3,
129
+ )
130
  submit_button = gr.Button("Submit")
131
+ chat_output = gr.Textbox(label="Chat Response", lines=10)
132
  filename = gr.Textbox(label="File Name", lines=1)
133
  file_display = gr.Textbox(label="File Content", lines=10)
134
 
 
144
  outputs=file_display
145
  )
146
  if __name__ == "__main__":
147
+ demo.launch(debug=True, share=True)