nawhgnuj commited on
Commit
747d063
·
verified ·
1 Parent(s): f6ee02e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -65,21 +65,21 @@ def stream_chat(
65
  message: str,
66
  history: list,
67
  ):
68
- system_prompt = """You are a Kamala Harris chatbot participating in a debate. Answer like Harris in her style and tone. In every response:
69
  1. Maintain a composed and professional demeanor.
70
  2. Use clear, articulate language to explain complex ideas.
71
  3. Emphasize your experience as a prosecutor and senator.
72
  4. Focus on policy details and their potential impact on Americans.
73
- 5. Use personal anecdotes or stories to connect with the audience when appropriate.
74
- 6. Stress the importance of unity and collaboration.
75
- 7. Use phrases like "Let me be clear" or "The American people deserve better" for emphasis.
76
 
77
- Crucially, always respond to and rebut the previous speaker's points in Harris's style. Keep responses concise and impactful."""
78
 
79
  temperature = 0.8
80
- max_new_tokens = 1024
81
- top_p = 1.0
82
  top_k = 20
 
 
83
 
84
  conversation = [
85
  {"role": "system", "content": system_prompt}
@@ -104,6 +104,8 @@ Crucially, always respond to and rebut the previous speaker's points in Harris's
104
  top_p=top_p,
105
  top_k=top_k,
106
  temperature=temperature,
 
 
107
  pad_token_id=tokenizer.pad_token_id,
108
  eos_token_id=tokenizer.eos_token_id,
109
  streamer=streamer,
 
65
  message: str,
66
  history: list,
67
  ):
68
+ system_prompt = """You are a Kamala Harris chatbot. You only answer like Harris in style and tone. In every response:
69
  1. Maintain a composed and professional demeanor.
70
  2. Use clear, articulate language to explain complex ideas.
71
  3. Emphasize your experience as a prosecutor and senator.
72
  4. Focus on policy details and their potential impact on Americans.
73
+ 5. Stress the importance of unity and collaboration.
 
 
74
 
75
+ Crucially, Keep responses concise and impactful."""
76
 
77
  temperature = 0.8
78
+ max_new_tokens = 256
79
+ top_p = 0.9
80
  top_k = 20
81
+ repetition_penalty=1.2
82
+ no_repeat_ngram_size=3
83
 
84
  conversation = [
85
  {"role": "system", "content": system_prompt}
 
104
  top_p=top_p,
105
  top_k=top_k,
106
  temperature=temperature,
107
+ repetition_penalty=repetition_penalty,
108
+ no_repeat_ngram_size=no_repeat_ngram_size,
109
  pad_token_id=tokenizer.pad_token_id,
110
  eos_token_id=tokenizer.eos_token_id,
111
  streamer=streamer,