braindeck commited on
Commit ·
bf33a33
1
Parent(s): fb0bb52
Remove think block from response
Browse files17 unmodified lines181920212223242526272818 unmodified lines474849455017 unmodified lines # Decode the generated text generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True) # Remove the think block ix = generated_text.find("</think>") if ix != -1: generated_text = generated_text[ix + len("</think>") :].lstrip() return generated_text
18 unmodified lines )
if __name__ == "__main__": demo.launch() demo.launch()app.py+6-1