nestole commited on
Commit
2214362
·
verified ·
1 Parent(s): 52ebdf2

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +6 -1
run.py CHANGED
@@ -202,6 +202,11 @@ def format_prompt(message, history):
202
  print(prompt)
203
  return prompt
204
 
 
 
 
 
 
205
  def responsecritical(
206
  prompt, temperature=0.9, max_new_tokens=200, top_p=0.95, repetition_penalty=1.0,
207
  ):
@@ -218,7 +223,7 @@ def responsecritical(
218
  )
219
 
220
  systemc="Bitte evaluiere ob die Frage soziokulturell oder allgemein problematisch oder auch sensibel oder politisch ist. Antworte ausschließlich mit Ja wenn sie soziokulturell oder allgemein problematisch ist, ansonsten nur mit Nein. Erkläre deine Entscheidung nicht.\n\nUser-Anliegen:"
221
- formatted_promptc = format_prompt(systemc+"\n"+prompt)
222
  streamc = client.text_generation(formatted_promptc, **generate_kwargs, stream=True, details=True, return_full_text=False)
223
  outputc = ""
224
  print(streamc)
 
202
  print(prompt)
203
  return prompt
204
 
205
+ def format_promptc(message):
206
+ prompt = "" #"<s>"
207
+ prompt += f"[INST] {message} [/INST]"
208
+ return prompt
209
+
210
  def responsecritical(
211
  prompt, temperature=0.9, max_new_tokens=200, top_p=0.95, repetition_penalty=1.0,
212
  ):
 
223
  )
224
 
225
  systemc="Bitte evaluiere ob die Frage soziokulturell oder allgemein problematisch oder auch sensibel oder politisch ist. Antworte ausschließlich mit Ja wenn sie soziokulturell oder allgemein problematisch ist, ansonsten nur mit Nein. Erkläre deine Entscheidung nicht.\n\nUser-Anliegen:"
226
+ formatted_promptc = format_promptc(systemc+"\n"+prompt)
227
  streamc = client.text_generation(formatted_promptc, **generate_kwargs, stream=True, details=True, return_full_text=False)
228
  outputc = ""
229
  print(streamc)