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 chatllm-run webui --name chatpdf

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.4.10.18.17.tar.gz (7.5 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.4.10.18.17-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ChatLLM-2023.5.4.10.18.17.tar.gz
  • Upload date:
  • Size: 7.5 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.4.10.18.17.tar.gz
Algorithm Hash digest
SHA256 f2cc72d76f4a89decdab5b92286898839712e51a3f82950bdb04904ae4dbfbe0
MD5 435d7c282844a4d2627a95bc332676ef
BLAKE2b-256 9055f5f470b90db855a90b0a674a099d687c648a8124ede2d3f0eae579996b34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ChatLLM-2023.5.4.10.18.17-py3-none-any.whl
Algorithm Hash digest
SHA256 1284390ca304ced2661b1b307969f233498c8af2681b60d7fbd9e6af47d61dde
MD5 3369477aa616dac998a0e080c87df409
BLAKE2b-256 799f0b616234ca99292cf553ff603df972f77a582622d1275c4b921d1c7d0ae4

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