暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

DB-GPT v0.5.9 版本更新, 新增 Agent 模块开发文档、支持谷歌 gemma-2 模型等新特性

EosphorosAI 2024-07-01
186

 

亲爱的 DB-GPT 社区伙伴们,DB-GPT v0.5.9 版本发布啦,接下来我们一起看看该版本带来哪些变化吧:

 新特性 



🌟  支持以数据库作为模型注册中心实现集群部署高可用

1)变更表结构:

    -- For deploy model cluster of DB-GPT(StorageModelRegistry)
    CREATE TABLE IF NOT EXISTS `dbgpt_cluster_registry_instance` (
    `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Auto increment id',
    `model_name` varchar(128) NOT NULL COMMENT 'Model name',
    `host` varchar(128) NOT NULL COMMENT 'Host of the model',
    `port` int(11) NOT NULL COMMENT 'Port of the model',
    `weight` float DEFAULT 1.0 COMMENT 'Weight of the model',
    `check_healthy` tinyint(1) DEFAULT 1 COMMENT 'Whether to check the health of the model',
    `healthy` tinyint(1) DEFAULT 0 COMMENT 'Whether the model is healthy',
    `enabled` tinyint(1) DEFAULT 1 COMMENT 'Whether the model is enabled',
    `prompt_template` varchar(128) DEFAULT NULL COMMENT 'Prompt template for the model instance',
    `last_heartbeat` datetime DEFAULT NULL COMMENT 'Last heartbeat time of the model instance',
    `user_name` varchar(128) DEFAULT NULL COMMENT 'User name',
    `sys_code` varchar(128) DEFAULT NULL COMMENT 'System code',
    `gmt_created` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Record creation time',
    `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Record update time',
    PRIMARY KEY (`id`),
    UNIQUE KEY `uk_model_instance` (`model_name`, `host`, `port`, `sys_code`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='Cluster model instance table, for registering and managing model instances';


    2.我们需要在两台机器(server1和server2)上启动模型控制器,它们将通过连接到同一数据库来共享元数据。在 server1 上启动模型控制器:
      dbgpt start controller \
      --port 8000 \
      --registry_type database \
      --registry_db_type mysql \
      --registry_db_name dbgpt \
      --registry_db_host 127.0.0.1 \
      --registry_db_port 3306 \
      --registry_db_user root \
      --registry_db_password aa123456

      server2 上启动模型控制器:

        dbgpt start controller \
        --port 8000 \
        --registry_type database \
        --registry_db_type mysql \
        --registry_db_name dbgpt \
        --registry_db_host 127.0.0.1 \
        --registry_db_port 3306 \
        --registry_db_user root \
        --registry_db_password aa123456
        3. 启动 Model Worker
          dbgpt start worker --model_name glm-4-9b-chat \
          --model_path app/models/glm-4-9b-chat \
          --port 8001 \
          --controller_addr "http://server1:8000,http://server2:8000"
          4. 启动 Embedding Model Worker
            dbgpt start worker --model_name text2vec \
            --model_path app/models/text2vec-large-chinese \
            --worker_type text2vec \
            --port 8003 \
            --controller_addr "http://server1:8000,http://server2:8000"
            5. 启动 Web Server
              LLM_MODEL=glm-4-9b-chat EMBEDDING_MODEL=text2vec \
              dbgpt start webserver \
              --light \
              --remote_embedding \
              --controller_addr "http://server1:8000,http://server2:8000"

              更多细节可以查看文档:

              https://docs.dbgpt.site/docs/latest/installation/model_service/cluster_ha/

              🌟  新增 Agent
               模块开发文档

              文档地址:

              https://docs.dbgpt.site/docs/latest/agents/introduction/

              🌟 支持谷歌新开源 gemma-2 模型

              需要升级 transformers 库到最新版

                pip install -U "transformers>=4.42.1"

                下载对应的模型权重到 DB-GPT 项目的 models 目录下(或者创建软连接到models目录下)

                修改.env
                文件

                  LLM_MODEL=gemma-2-9b-it
                  # LLM_MODEL=gemma-2-27b-it
                  ## 下面配置开启量化
                  # QUANTIZE_8bit=False
                  # QUANTIZE_4bit=False
                  🌟 支持 DeepSeek-Coder-V2 模型

                  下载对应的模型权重到 DB-GPT 项目的 models 目录下(或者创建软连接到models目录下)

                  修改.env
                  文件

                    LLM_MODEL=deepseek-coder-v2-lite-instruct
                    # LLM_MODEL=deepseek-coder-v2-instruct
                    🌟 支持通义 Embedding

                    .env
                    里面进行设置

                      EMBEDDING_MODEL=proxy_tongyi
                      proxy_tongyi_proxy_backend=text-embedding-v1
                      proxy_tongyi_proxy_api_key={your-api-key}
                      🌟 新增图片下载功能

                      🌟 折线图显示优化

                      优化前:

                      优化后:


                       Bug 修复 


                      • 修复chroma db 打分问题

                      • 修复AWEL branch分支问题

                      • 修复scheme linking error问题


                       致谢 


                      感谢所有贡献者使这次发布成为可能! 

                      @Aries-ckt, @Armandwt, @aagnone3, @chenluli, @fangyinc and @zhenchaozhu

                      附录
                      01
                       DB-GPT 框架
                      https://github.com/eosphoros-ai/DB-GPT
                      02
                      Text2SQL 微调
                      https://github.com/eosphoros-ai/DB-GPT-Hub
                      03
                       DB-GPT 前端可视化项目
                      https://github.com/eosphoros-ai/DB-GPT-Web
                      04
                       DB-GPT 插件仓库
                      https://github.com/eosphoros-ai/dbgpts
                      05
                       Text2SQL学习资料和前沿跟踪
                      https://github.com/eosphoros-ai/Awesome-Text2SQL
                      06
                       中文官方文档
                      https://www.yuque.com/eosphoros/dbgpt-docs/bex30nsv60ru0fmx
                      07
                       英文官方文档
                      http://docs.dbgpt.site/docs/overview
                      08
                       视频教程
                      项目介绍:https://www.bilibili.com/video/BV1Dr421W7mb/?vd_source=291a25eab97f9bbddf3c20a1969f2cdf
                      安装部署:https://www.bilibili.com/video/BV1JW421N7T5/?spm_id_from=333.999.list.card_archive.click&vd_source=291a25eab97f9bbddf3c20a1969f2cdf

                      文章转载自EosphorosAI,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

                      评论