tatianija commited on
Commit
48cda19
·
verified ·
1 Parent(s): 1cace20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -439,7 +439,9 @@ Example responses:
439
  """
440
  context_section = f"\n\nAttachment Context:\n{attachment_context}" if attachment_context else ""
441
 
442
- answer_prompt = f"""You are a general AI assistant. I will ask you a question. YOUR ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string. Do not add a dot after the numbers.
 
 
443
 
444
  {context_section}
445
 
@@ -491,8 +493,15 @@ Answer:"""
491
  # Generate answer using search context and attachment context
492
  context_section = f"\n\nAttachment Context:\n{attachment_context}" if attachment_context else ""
493
 
494
- answer_prompt = f"""You are a general AI assistant. I will ask you a question. Based on the search results and context section below, provide an answer to the question. If the search results don't fully answer the question, you can supplement with your general knowledge. Do not add dot if your answer is a number.
495
- Your ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
 
 
 
 
 
 
 
496
 
497
  Question: {question}
498
 
@@ -907,7 +916,6 @@ with gr.Blocks(title="Intelligent Agent with Media Processing") as demo:
907
  gr.Markdown("### Fetch Questions from API")
908
  fetch_btn = gr.Button("Fetch Questions", variant="primary")
909
  fetch_status = gr.Textbox(label="Fetch Status", lines=2, interactive=False)
910
- questions_table = gr.DataFrame(label="Available Questions", wrap=True)
911
 
912
  fetch_btn.click(
913
  fn=fetch_questions,
 
439
  """
440
  context_section = f"\n\nAttachment Context:\n{attachment_context}" if attachment_context else ""
441
 
442
+ answer_prompt = f"""You are a general AI assistant. I will ask you a question.
443
+ YOUR ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
444
+ If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string. Do not add a dot after the numbers.
445
 
446
  {context_section}
447
 
 
493
  # Generate answer using search context and attachment context
494
  context_section = f"\n\nAttachment Context:\n{attachment_context}" if attachment_context else ""
495
 
496
+ answer_prompt = f"""You are a general AI assistant. I will ask you a question.
497
+ Based on the search results and the context section below, provide an answer to the question.
498
+ If the search results don't fully answer the question, you can supplement with your general knowledge.
499
+ Your ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
500
+ Do not add dot if your answer is a number.
501
+ If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise.
502
+ If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
503
+ If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
504
+ Do nor report on your thoughts.
505
 
506
  Question: {question}
507
 
 
916
  gr.Markdown("### Fetch Questions from API")
917
  fetch_btn = gr.Button("Fetch Questions", variant="primary")
918
  fetch_status = gr.Textbox(label="Fetch Status", lines=2, interactive=False)
 
919
 
920
  fetch_btn.click(
921
  fn=fetch_questions,