Skip to main content

Create a Python package.

Project description

image image image

🔥ChatLLM 基于知识库🔥

Install

pip install -U chatllm

Docs

Usages

from chatllm.applications import ChatBase

qa = ChatBase()
qa.load_llm4chat(model_name_or_path="THUDM/chatglm-6b")

_ = list(qa(query='周杰伦是谁', knowledge_base='周杰伦是傻子', role=' '))
# 根据已知信息无法回答该问题,因为周杰伦是中国内地流行歌手、演员、音乐制作人、导演,
# 是具有一定的知名度和专业能力的人物,没有提供足够的信息无法判断他是傻子。
  • 支持角色扮演 img.png

ChatPDF

Click to ChatPDF
  • 一键启动UI
pip install "chatllm[pdf]" && chatllm-run webui --name chatpdf
  • python交互
from chatllm.applications.chatpdf import ChatPDF

qa = ChatPDF(encode_model='nghuyong/ernie-3.0-nano-zh')
qa.load_llm4chat(model_name_or_path="THUDM/chatglm-6b")
qa.create_index('财报.pdf')  # 构建知识库

list(qa(query='东北证券主营业务'))
# 根据已知信息,东北证券的主营业务为证券业务。公司作为证券公司,主要从事证券经纪、证券投资咨询、与证券交易、
# 证券投资活动有关的财务顾问、证券承销与保荐、证券自营、融资融券、证券投资基金代销和代销金融产品待业务。
  • 支持召回结果查看 向量召回结果

Deploy

Click to Deploy

TODO

Click to TODO
  • ChatLLM 应用

    • 接入非结构化文档(已支持 md、pdf、docx、txt 文件格式)
    • 搜索引擎与本地网页接入
    • 结构化数据接入(如 csv、Excel、SQL 等)
    • 知识图谱/图数据库接入
    • 增加 ANN 后端,ES/RedisSearch【确保生产高可用】
    • 增加多级缓存缓存
  • 多路召回

      • 标量匹配
      • 多种向量化,向量匹配
      • 增加相似问,换几个问法
      • 高置信度直接返回答案【匹配标准问】
      • 高置信度篇章
      • 增加上下文信息
      • 增加夸篇章信息
      • 增加召回信息的相似信息
      • 提前生成标准问,匹配问
      • 拒绝推断
  • 增加更多 LLM 模型支持

  • 增加更多 Embedding 模型支持

  • 增加一键启动 webui

    • 利用 streamlit 实现 ChatPDF,一键启动 chatllm-run webui --name chatpdf
    • 利用 gradio 实现 Web UI DEMO
    • 添加输出内容及错误提示
    • 引用标注
    • 增加知识库管理
      • 选择知识库开始问答
      • 上传文件/文件夹至知识库
      • 删除知识库中文件
  • 增加 API 支持

    • 利用 Fastapi/Flask/Grpc 实现流式接口 chatllm-run flask-api --model_name_or_path <MODEL_PATH> --host 127.0.0.1 --port 8000
    • 前后端分离,实现调用 API 的 Web UI Demo

交流群

======= History

0.0.0 (2023-04-11)

  • First release on PyPI.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ChatLLM-2023.5.15.17.17.47.tar.gz (9.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ChatLLM-2023.5.15.17.17.47-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file ChatLLM-2023.5.15.17.17.47.tar.gz.

File metadata

  • Download URL: ChatLLM-2023.5.15.17.17.47.tar.gz
  • Upload date:
  • Size: 9.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for ChatLLM-2023.5.15.17.17.47.tar.gz
Algorithm Hash digest
SHA256 136a355d8697c777a94537b63cf7000881e91a46b1c7af4fc4ce3fa415f73c4d
MD5 fd7e55436af9daab9c7aebf37385bd2e
BLAKE2b-256 6e072ea7174fe999672741159a4d175baa5be25687b60c6e08d22eadf5903885

See more details on using hashes here.

File details

Details for the file ChatLLM-2023.5.15.17.17.47-py3-none-any.whl.

File metadata

File hashes

Hashes for ChatLLM-2023.5.15.17.17.47-py3-none-any.whl
Algorithm Hash digest
SHA256 b236042dbe312e1f362542559f02893031e8d0fe19570b80d1b43f41f0c09930
MD5 3226c93695c7fe30db44031fae34a8cf
BLAKE2b-256 0b4155ad5d59f8c28bf2ab8ad3285c2f670047fcd37bdb0def5871f0188244dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page