hysts HF staff commited on
Commit
f521515
1 Parent(s): 1a22e7a
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -1,4 +1,3 @@
1
- import os
2
  from typing import Iterator
3
 
4
  import gradio as gr
@@ -6,8 +5,10 @@ import torch
6
 
7
  from model import run
8
 
9
- DEFAULT_SYSTEM_PROMPT = """
10
- 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.\n\nIf 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.
 
 
11
  """
12
  MAX_MAX_NEW_TOKENS = 2048
13
  DEFAULT_MAX_NEW_TOKENS = 1024
@@ -154,7 +155,7 @@ with gr.Blocks(css='style.css') as demo:
154
  inputs=textbox,
155
  outputs=[textbox, chatbot],
156
  fn=process_example,
157
- cache_examples=os.getenv('CACHE_EXAMPLES') == '1',
158
  )
159
 
160
  gr.Markdown(LICENSE)
 
 
1
  from typing import Iterator
2
 
3
  import gradio as gr
 
5
 
6
  from model import run
7
 
8
+ DEFAULT_SYSTEM_PROMPT = """\
9
+ 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.
10
+
11
+ 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.\
12
  """
13
  MAX_MAX_NEW_TOKENS = 2048
14
  DEFAULT_MAX_NEW_TOKENS = 1024
 
155
  inputs=textbox,
156
  outputs=[textbox, chatbot],
157
  fn=process_example,
158
+ cache_examples=True,
159
  )
160
 
161
  gr.Markdown(LICENSE)