Open dbtzy opened 7 months ago
chatglm2是否有类似openai中stop的接口?
No response
我希望实现chatglm2在生成答案时如果生成的字符满足stop中的字符就停止生成。
假设没有设置stop,模型回答SQLQuery: SELECT COUNT(*) FROM Customer\nSQLResult: 3,在设置stop=["\nSQLResult:"]后,模型只输出SQLQuery: SELECT COUNT(*) FROM Customer
SQLQuery: SELECT COUNT(*) FROM Customer\nSQLResult: 3
stop=["\nSQLResult:"]
SQLQuery: SELECT COUNT(*) FROM Customer
是否存在这样的接口?
- OS: Ubuntu 22.04 - Python: 3.10.13 - Transformers: 4.35.2 - PyTorch: 2.1.0 - CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) : True
Is there an existing issue for this?
Current Behavior
chatglm2是否有类似openai中stop的接口?
Expected Behavior
No response
Steps To Reproduce
我希望实现chatglm2在生成答案时如果生成的字符满足stop中的字符就停止生成。
假设没有设置stop,模型回答
SQLQuery: SELECT COUNT(*) FROM Customer\nSQLResult: 3
,在设置stop=["\nSQLResult:"]
后,模型只输出SQLQuery: SELECT COUNT(*) FROM Customer
是否存在这样的接口?
Environment
Anything else?
No response