PyaeSoneK commited on
Commit
a92c384
·
1 Parent(s): 490fac6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,7 +6,7 @@ from transformers import AutoModel
6
  import torch
7
  import transformers
8
  from transformers import AutoTokenizer, AutoModelForCausalLM
9
- from accelerate import init_empty_weights, load_checkpoint_and_dispatch
10
 
11
  # App framework
12
  st.title('🦜Seon\'s Legal QA For Dummies 🔗 ')
@@ -50,7 +50,7 @@ B_SYS, E_SYS = "<>\n", "\n<>\n\n"
50
  DEFAULT_SYSTEM_PROMPT = """\
51
  You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
52
 
53
- If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information."""
54
 
55
 
56
  def get_prompt(instruction, new_system_prompt=DEFAULT_SYSTEM_PROMPT, citation=None):
@@ -114,7 +114,7 @@ text = st.text_input('Plug in your prompt here')
114
 
115
  if text:
116
  response = llm_chain.run(text)
117
- st.write(parse_text(response))
118
 
119
 
120
 
 
6
  import torch
7
  import transformers
8
  from transformers import AutoTokenizer, AutoModelForCausalLM
9
+
10
 
11
  # App framework
12
  st.title('🦜Seon\'s Legal QA For Dummies 🔗 ')
 
50
  DEFAULT_SYSTEM_PROMPT = """\
51
  You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
52
 
53
+ If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.Just say you don't know and you are sorry!"""
54
 
55
 
56
  def get_prompt(instruction, new_system_prompt=DEFAULT_SYSTEM_PROMPT, citation=None):
 
114
 
115
  if text:
116
  response = llm_chain.run(text)
117
+ st.write(response)
118
 
119
 
120