cubenlp / ChatSQL

自然语言转SQL,直接连接数据库查询
Apache License 2.0
365 stars 48 forks source link

返回sql由于空格问题导致执行失败 #6

Closed losemy closed 1 year ago

losemy commented 1 year ago

好的,让我们开始查询:

SELECTcargo_name FROMcargo WHEREnet_yield>10

这将返回在2019年销售的货物名称。

sql语句执行失败

near "SELECTcargo_name": syntax error

losemy commented 1 year ago

utils.py 中 In_context_prompt 使用有问题 导致的 去掉 以下就可以了

if is_moss:

In_context_prompt = In_context_prompt.replace("问: ", "<|Human|>: ").replace("答:", "")