Cyantist8208 commited on
Commit
3a2aec0
·
1 Parent(s): 3fa795a

without end

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -192,10 +192,13 @@ def answer(system: str, context: str, question: str,
192
  full = tokenizer.decode(output[0], skip_special_tokens=False)
193
 
194
  start = "<|start_header_id|>assistant<|end_header_id|>\n\n"
 
195
  end = "<|eot_id|>"
196
 
197
  if start in full:
198
  reply = full.split(start)[-1].split(end)[0].strip()
 
 
199
  else:
200
  reply = full
201
 
 
192
  full = tokenizer.decode(output[0], skip_special_tokens=False)
193
 
194
  start = "<|start_header_id|>assistant<|end_header_id|>\n\n"
195
+ startwithoutend = "<|start_header_id|>assistant"
196
  end = "<|eot_id|>"
197
 
198
  if start in full:
199
  reply = full.split(start)[-1].split(end)[0].strip()
200
+ elif startwithoutend in full:
201
+ reply = full.split(startwithoutend)[-1].split(end)[0].strip()
202
  else:
203
  reply = full
204