Spaces:
Paused
Paused
Update app.py
Browse files
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
|
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.
|
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,
|
78 |
|
79 |
temperature = 0.8
|
80 |
-
max_new_tokens =
|
81 |
-
top_p =
|
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,
|