kenchan0226 commited on
Commit
113ecfa
·
verified ·
1 Parent(s): 773571d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -31,6 +31,9 @@ model.config.sliding_window = 4096
31
  model.eval()
32
 
33
 
 
 
 
34
  @spaces.GPU(duration=90)
35
  def generate(
36
  message: str,
@@ -41,7 +44,7 @@ def generate(
41
  top_k: int = 50,
42
  repetition_penalty: float = 1.2,
43
  ) -> Iterator[str]:
44
- conversation = []
45
  for user, assistant in chat_history:
46
  conversation.extend(
47
  [
 
31
  model.eval()
32
 
33
 
34
+ system_prompt = "You are a helpful assistant."
35
+
36
+
37
  @spaces.GPU(duration=90)
38
  def generate(
39
  message: str,
 
44
  top_k: int = 50,
45
  repetition_penalty: float = 1.2,
46
  ) -> Iterator[str]:
47
+ conversation = [{"role": "system", "content": system_prompt}]
48
  for user, assistant in chat_history:
49
  conversation.extend(
50
  [