You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gr.Markdown("<h1><center>Lightweight PDF / web page QA bot</center></h1>")
225
225
226
-
gr.Markdown(f"""Chat with PDF, web page or (new) csv/Excel documents. The default is a small model ({SMALL_MODEL_NAME}), that can only answer specific questions that are answered in the text. It cannot give overall impressions of, or summarise the document. The alternative ({LARGE_MODEL_NAME}, if available), can reason a little better, but is much slower (See Advanced settings tab).\n\nBy default '[{DEFAULT_DATA_SOURCE_NAME}]({DEFAULT_DATA_SOURCE})' is loaded.If you want to talk about another document or web page, please select from the second tab. If switching topic, please click the 'Clear chat' button.\n\nCaution: This is a public app. Please ensure that the document you upload is not sensitive is any way as other users may see it! Also, please note that LLM chatbots may give incomplete or incorrect information, so please use with care.""")
226
+
gr.Markdown(f"""Chat with PDFs, web pages or data files (.csv / .xlsx). The default is a small model ({SMALL_MODEL_NAME}), that can only answer specific questions that are answered in the text. It cannot give overall impressions of, or summarise the document. Go to Advanced settings to change model to e.g. a choice of Gemini models that are available on [their very generous free tier](https://ai.google.dev/gemini-api/docs/pricing) (needs an API key), or AWS Bedrock/larger local models if activated.\n\nBy default '[{DEFAULT_DATA_SOURCE_NAME}]({DEFAULT_DATA_SOURCE})' is loaded as a data source. If you want to query another data source, please upload it on the 'Change data source' tab. If switching topic, please click the 'Clear chat' button. 'Stop generating' will halt the language model during its response.\n\n**Caution: On Hugging Face, this is a public app. Please ensure that the document you upload is not sensitive is any way as other users may see it!** Also, please note that AI chatbots may give incomplete or incorrect information, so please use with care and ensure that you verify any outputs before further use.""")
227
227
228
228
withgr.Row():
229
229
current_source=gr.Textbox(label="Current data source(s)", value=DEFAULT_DATA_SOURCE, scale=10)
current_topic=gr.Textbox(label="Feature currently disabled - Keywords related to current conversation topic.", placeholder="Keywords related to the conversation topic will appear here", visible=False)
DEFAULT_EXAMPLES=get_or_create_env_var('DEFAULT_EXAMPLES', '[ "How can I make a custom deny list?", "How can I find page duplicates?", "How can I review and modify existing redactions?", "How can I export my review files to Adobe?"]')
219
+
DEFAULT_EXAMPLES=get_or_create_env_var('DEFAULT_EXAMPLES', '[ "How can I make a custom deny list?", "How can I find duplicate pages in a document?", "How can I review and modify existing redactions?", "How can I export my review files to Adobe?"]')
220
220
#
221
221
# ') # ["What were the five pillars of the previous borough plan?",
Copy file name to clipboardExpand all lines: chatfuncs/prompts.py
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,14 @@
73
73
Answer:<|im_end|>
74
74
<|im_start|>assistant\n"""
75
75
76
-
instruction_prompt_gemma="""Answer the QUESTION using information from the following CONTENT. Respond with short answers that directly answer the question.
76
+
instruction_prompt_gemma="""<start_of_turn>user
77
+
Answer the QUESTION using information from the following CONTENT. Make sure to fully answer the question with all required detail.
78
+
CONTENT: {summaries}
79
+
QUESTION: {question}<end_of_turn>
80
+
<start_of_turn>model
81
+
"""
82
+
83
+
instruction_prompt_template_gemini_aws="""Answer the QUESTION with a using information from the following CONTENT. Make sure to fully answer the question with all required detail.
0 commit comments