ffreemt commited on
Commit
b95b0ac
1 Parent(s): cddd650

Update prompt_template

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -37,6 +37,22 @@ human_prefix = "USER"
37
  ai_prefix = "ASSISTANT"
38
  stop_list = [f"{human_prefix}:"]
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  _ = psutil.cpu_count(logical=False) - 1
41
  cpu_count: int = int(_) if _ else 1
42
  logger.debug(f"{cpu_count=}")
@@ -76,7 +92,7 @@ class GenerationConfig:
76
  reset: bool = False
77
  stream: bool = True
78
  threads: int = cpu_count
79
- stop: list[str] = field(default_factory=lambda: stop_list)
80
 
81
 
82
  def generate(
 
37
  ai_prefix = "ASSISTANT"
38
  stop_list = [f"{human_prefix}:"]
39
 
40
+ prompt_template = """[INST]
41
+ <<SYS>>
42
+ 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.
43
+
44
+ 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.
45
+ <</SYS>>
46
+ {question}
47
+ [/INST]"""
48
+
49
+ prompt_template = """[INST] <<SYS>>
50
+ You are a helpful assistant.
51
+ <</SYS>>
52
+
53
+ {question} [/INST]
54
+ """
55
+
56
  _ = psutil.cpu_count(logical=False) - 1
57
  cpu_count: int = int(_) if _ else 1
58
  logger.debug(f"{cpu_count=}")
 
92
  reset: bool = False
93
  stream: bool = True
94
  threads: int = cpu_count
95
+ # stop: list[str] = field(default_factory=lambda: stop_list)
96
 
97
 
98
  def generate(