Skip to content

[Help] 请教个问题,我想微调chatglm以更好的完成text2sql的场景,请问prompt该怎么设计比较好? #737

Closed

Description

@goingHan

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

我目前使用的prompt的格式类似这样的:

`
_我们要将用户的问题翻译为一个mysql的sql语句。
问题涉及的数据表的信息是:

表名:a_activity_instance
表结构:
activity_instance_id    活动实例ID
activity_type_id    活动类型ID
activity_code   活动编码
busi_category   业务类型,参见"活动业务分类"表的配置

用户的问题是:

get all activity_instance_id of activity?

将用户的问题翻译为mysql的sql语句,sql语句是:

`

想请教一下这样正确不? 如果这样的话,pre_seq_len 就要设置的比较大,会不会对最后的效果有影响? 麻烦大佬给一些建议,跪谢。

Expected Behavior

None

Steps To Reproduce

None

Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :

Anything else?

No response

Activity

  1. changed the title [-][BUG/Help] 请教个问题,我想微调chatglm以更好的完成text2sql的场景,请问prompt该怎么涉及比较好?[/-] [+][BUG/Help] 请教个问题,我想微调chatglm以更好的完成text2sql的场景,请问prompt该怎么设计比较好?[/+] on Apr 20, 2023
  2. changed the title [-][BUG/Help] 请教个问题,我想微调chatglm以更好的完成text2sql的场景,请问prompt该怎么设计比较好?[/-] [+][Help] 请教个问题,我想微调chatglm以更好的完成text2sql的场景,请问prompt该怎么设计比较好?[/+] on Apr 20, 2023
  3. liaoxingjian commented on Apr 23, 2023

    @liaoxingjian

    我也有这个问题🥹

  4. nuo-o commented on Apr 25, 2023

    @nuo-o

    我也有类似的问题,我现在是很笨的方法。先建立本地的知识库,写明每个表能干什么,再用langchain+chatglm 回答。很笨。因为有一大堆需要配置的。

  5. PerseveranceZ commented on Apr 27, 2023

    @PerseveranceZ

    +1

  6. nuo-o commented on Apr 27, 2023

    @nuo-o
  7. stormeyes commented on Jun 6, 2023

    @stormeyes

    看看这个:https://github.com/yysirs/ChatSQL

    这个是基于向量搜索的,不是基于微调的

  8. kanseaveg commented on Jul 9, 2023

    @kanseaveg

    正在尝试,敬请期待~

  9. locked and limited conversation to collaborators on Aug 16, 2023
  10. converted this issue into a discussion #1380 on Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions