defog-ai / sqlcoder

SoTA LLM for converting natural language questions to SQL queries
Apache License 2.0
3.27k stars 205 forks source link

运行不出结果。。。 #50

Closed xxm1668 closed 7 months ago

xxm1668 commented 9 months ago
image
BetterwithMe commented 9 months ago

我也是 有什么解决办法么

yjwsyq commented 9 months ago

我也是一样的情况,请问是哪里出了问题?

Xingeqwd commented 9 months ago

太对了,同志们,我也是这个问题,推测可能这两周,他们的什么文件出了问题

SiChengliang commented 9 months ago

yes,sqlcoder34B-alpha version has no results, while sqlcoder2 has a relatively poor performance but a result

Xingeqwd commented 9 months ago

yes,sqlcoder34B-alpha version has no results, while sqlcoder2 has a relatively poor performance but a result

是这样吗,扑朔迷离啊,我当时好像也是用的sqlcoder2,请问你是用的什么方案?是ollama,或者直接是官方方案inference?

Peroplex commented 9 months ago

我也一样,7b的模型原样返回输入

SiChengliang commented 9 months ago

I figure out why there are no relsult. for me, it's because the library version is too low, should update. finally, update the environment to image it has output.

xxm1668 commented 9 months ago

@SiChengliang 中文能力如何?

Xingeqwd commented 9 months ago

我也一样,7b的模型原样返回输入

是啊,很多人都有这问题,这个可靠性应该不怎么高(大概率是这几天什么更新把模型更坏了) 我是干运维的,领导叫我弄,我换了好几个方案

其实没什么靠谱的。。。只有自己去做“TEXTtoSQL微调” 谷歌找一找,我感觉很有可行性,这几天就搞

ltcs11 commented 7 months ago
raw_result = pipe(prompt,
                  num_return_sequences=1,
                  eos_token_id=eos_token_id,
                  pad_token_id=eos_token_id,
                  )[0]["generated_text"]

原始输出是有结果的,是后面的连续split格式不对导致输出没有截取出来

测试的defog/sqlcoder,demo question(What are our top 3 products by revenue in the New York region?) transformer版本也不是很新4.33.1 原始输出是ok的

wongjingping commented 7 months ago

@xxm1668 对不起,我们提供的prompt需要最后再加一部分,例如:

# Task
Generate a SQL query to answer the question `...`

# Database Schema
...

# SQL
Given the question, here is the sql:

你可以参考 https://github.com/defog-ai/sql-eval/blob/main/prompts/prompt.md 这里有我们最好的 prompt.

xxm1668 commented 7 months ago

好的,谢谢

Xingeqwd commented 7 months ago

@xxm1668 对不起,我们提供的prompt需要最后再加一部分,例如:

# Task
Generate a SQL query to answer the question `...`

# Database Schema
...

# SQL
Given the question, here is the sql:

你可以参考 https://github.com/defog-ai/sql-eval/blob/main/prompts/prompt.md 这里有我们最好的 prompt.

大佬,还请莫要客气,做出了这么好的模型,非常厉害了!感谢大佬