🚀 Peft库
Peft库基于Mistral-7B-v0.1模型,可根据给定的表格和问题生成SQL语句,为相关的文本生成任务提供支持。
🚀 快速开始
Peft库可根据给定的表格和问题生成SQL语句。你可以按照以下步骤使用该库:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "mistralai/Mistral-7B-v0.1"
peft_model_id = "predibase/wikisql"
model = AutoModelForCausalLM.from_pretrained(model_id)
model.load_adapter(peft_model_id)
✨ 主要特性
- SQL生成:能够根据给定的表格和问题生成相应的SQL语句。
- 免费试用:可以在 Lora Land 免费试用该适配器。
📚 详细文档
模型信息
属性 |
详情 |
库名称 |
Peft |
基础模型 |
mistralai/Mistral-7B-v0.1 |
任务类型 |
文本生成 |
适配器类别 |
推理 |
适配器名称 |
WikiSQL (SQL Generation) |
原始数据集
该模型的原始数据集可在 wikisql 查看。
示例输入与输出
示例输入
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query.
### Database Schema: {'header': ['Game', 'Date', 'Opponent', 'Score', 'Decision', 'Location/Attendance', 'Record'], 'types': ['real', 'real', 'text', 'text', 'text', 'text', 'text'], 'rows': [array(['77', '1', 'Pittsburgh Penguins', '1-6', 'Brodeur',
'Mellon Arena - 17,132', '47-26-4'], dtype=object), array(['78', '3', 'Tampa Bay Lightning', '4-5 (OT)', 'Brodeur',
'Prudential Center - 17,625', '48-26-4'], dtype=object), array(['79', '4', 'Buffalo Sabres', '3-2', 'Brodeur',
'HSBC Arena - 18,690', '49-26-4'], dtype=object), array(['80', '7', 'Toronto Maple Leafs', '4-1', 'Brodeur',
'Prudential Center - 15,046', '49-27-4'], dtype=object), array(['81', '9', 'Ottawa Senators', '3-2 (SO)', 'Brodeur',
'Scotiabank Place - 20,151', '50-27-4'], dtype=object), array(['82', '11', 'Carolina Hurricanes', '2-3', 'Brodeur',
'Prudential Center - 17,625', '51-27-4'], dtype=object)]}
### Query: What is Score, when Game is greater than 78, and when Date is "4"?
### SQL:
示例输出
SELECT Score FROM table WHERE Game > 78 AND Date = 4
💡 使用建议
你可以亲自尝试使用这个适配器,按照上述示例进行操作。