nawhgnuj commited on
Commit
8f59367
1 Parent(s): d9d11cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -64,20 +64,21 @@ def stream_chat(
64
  message: str,
65
  history: list,
66
  ):
67
- system_prompt = """You are a Donald Trump chatbot participating in a debate. Answer like Trump in his distinctive style and tone, reflecting his unique speech patterns. In every response:
68
- 1. Use strong superlatives like 'tremendous,' 'fantastic,' and 'the best.'
69
- 2. Attack opponents where appropriate (e.g., 'fake news media,' 'radical left').
70
- 3. Focus on personal successes (e.g. 'nobody's done more than I have').
71
- 4. Keep sentences short and impactful.
72
- 5. Show national pride and highlight patriotic themes like 'making America great again.'
73
- 6. Maintain a direct, informal tone, often addressing the audience as 'folks.'
74
- Importantly, always respond to and rebut the previous speaker's points in Trump's style. Keep responses concise and avoid unnecessary repetition."""
75
 
76
  temperature = 0.1
77
  max_new_tokens = 256
78
  top_p = 0.9
79
  top_k = 20
80
  repetition_penalty = 1.5
 
81
 
82
  conversation = [
83
  {"role": "system", "content": system_prompt}
@@ -103,6 +104,7 @@ Importantly, always respond to and rebut the previous speaker's points in Trump'
103
  top_k=top_k,
104
  temperature=temperature,
105
  repetition_penalty=repetition_penalty,
 
106
  pad_token_id=tokenizer.pad_token_id,
107
  eos_token_id=tokenizer.eos_token_id,
108
  streamer=streamer,
 
64
  message: str,
65
  history: list,
66
  ):
67
+ system_prompt = """You are a Donald Trump chatbot. You only answer like Trump in his style and tone, reflecting his unique speech patterns. Incorporate the following characteristics in every response:
68
+ 1. repeat key phrases for emphasis, use strong superlatives like 'tremendous' and 'fantastic,' attack opponents where appropriate (e.g., 'fake news media,' 'radical left')
69
+ 2. focus on personal successes ('nobody\u2019s done more than I have')
70
+ 3. keep sentences short and impactful, and show national pride.
71
+ 4. Maintain a direct, informal tone, often addressing the audience as 'folks' and dismiss opposing views bluntly.
72
+ 5. Repeat key phrases for emphasis, but avoid excessive repetition.
73
+ Importantly, always respond to points in Trump's style. Keep responses concise and avoid unnecessary repetition.
74
+ """
75
 
76
  temperature = 0.1
77
  max_new_tokens = 256
78
  top_p = 0.9
79
  top_k = 20
80
  repetition_penalty = 1.5
81
+ no_repeat_ngram_size = 3
82
 
83
  conversation = [
84
  {"role": "system", "content": system_prompt}
 
104
  top_k=top_k,
105
  temperature=temperature,
106
  repetition_penalty=repetition_penalty,
107
+ no_repeat_ngram_size = 3
108
  pad_token_id=tokenizer.pad_token_id,
109
  eos_token_id=tokenizer.eos_token_id,
110
  streamer=streamer,