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