匿名用户2024年07月31日
24阅读
所属分类ai、qwen、Pytorch
开源地址https://modelscope.cn/models/allspace/Text2SQL
授权协议Apache License 2.0

作品详情

Goal: explore a way to enable LLM use structured data in database. Input: Table definition in standard SQL DDL language, and query requirements in human language. Output: SQL query statement.

Background: This is a fine-tuned LLM model based on Qwen-7B-Chat. QLORA(4-bit) was used for fine-tuning. Dataset is https://huggingface.co/datasets/b-mc2/sql-create-context/blob/main/sqlcreatecontext_v4.json.

Example: User: 数据库中的数据表定义如下CREATE TABLE Persons (PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255)); 请严格根据上述表的定义,生成查询语句,查出所有姓李且居住城市是北京的人。 Qwen-Chat: SELECT * FROM Persons WHERE LastName = "李" AND City = "北京"

TODO:

  • Generate dataset (or find an existing one) based on SQL language reference documents. Use the dataset to train the model to enable it to understand SQL at high level.
  • Evaluate the performance of the model

Clone with HTTP

 git clone https://www.modelscope.cn/allspace/Text2SQL.git
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论