sam2ai commited on
Commit
fd4ceec
·
1 Parent(s): befb7d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -16,7 +16,7 @@ llm = Llama(
16
  # n_gpu_layers=50, # change n_gpu_layers if you have more or less VRAM
17
  )
18
 
19
- # history = []
20
 
21
  # system_message = """
22
  # 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.
@@ -24,7 +24,7 @@ llm = Llama(
24
  # """
25
 
26
 
27
- def generate_text(message):
28
  # temp = ""
29
  # input_prompt = f"[INST] <<SYS>>\n{system_message}\n<</SYS>>\n\n "
30
  # for interaction in history:
@@ -47,7 +47,7 @@ def generate_text(message):
47
  temp += stream["choices"][0]["text"]
48
  yield temp
49
 
50
- # history = ["init", input_prompt]
51
 
52
 
53
  demo = gr.ChatInterface(
 
16
  # n_gpu_layers=50, # change n_gpu_layers if you have more or less VRAM
17
  )
18
 
19
+ history = []
20
 
21
  # system_message = """
22
  # 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.
 
24
  # """
25
 
26
 
27
+ def generate_text(message, history):
28
  # temp = ""
29
  # input_prompt = f"[INST] <<SYS>>\n{system_message}\n<</SYS>>\n\n "
30
  # for interaction in history:
 
47
  temp += stream["choices"][0]["text"]
48
  yield temp
49
 
50
+ history = ["init", input_prompt]
51
 
52
 
53
  demo = gr.ChatInterface(