ucsahin commited on
Commit
43bafef
·
verified ·
1 Parent(s): c635389

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -44,10 +44,10 @@ def bot_streaming(message, history, max_tokens, temperature, top_p, top_k, repet
44
  model_outputs = model.generate(**generation_kwargs)
45
  dpo_outputs = model_dpo.generate(**generation_kwargs)
46
 
47
- model_output_text = processor.decode(model_outputs, skip_special_tokens=True)[len(prompt)+1]
48
- dpo_output_text = processor.decode(dpo_outputs, skip_special_tokens=True)[len(prompt)+1]
49
 
50
- generated_text = f"<h3>Base model cevabı:</h3>\n{model_output_text}\n<h3>DPO model cevabı:</h3>\n{dpo_output_text}"
51
 
52
  return generated_text
53
 
 
44
  model_outputs = model.generate(**generation_kwargs)
45
  dpo_outputs = model_dpo.generate(**generation_kwargs)
46
 
47
+ ref_text = processor.batch_decode(model_outputs, skip_special_tokens=True)[0]
48
+ dpo_text = processor.batch_decode(dpo_outputs, skip_special_tokens=True)[0]
49
 
50
+ generated_text = f"<h3>Base model cevabı:</h3>\n{ref_text[len(prompt)+1:]}\n<h3>DPO model cevabı:</h3>\n{dpo_text[len(prompt)+1]:}"
51
 
52
  return generated_text
53