Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
wzh1994 committed Jun 14, 2024
1 parent 696865c commit e0a4236
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/source/api/flow.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _api.flow:

lazyllm.Flow
-----------------------

.. _api.flow:

.. autoclass:: lazyllm.flow.FlowBase
:members: is_root, ancestor, for_each
:exclude-members:
Expand Down
7 changes: 5 additions & 2 deletions docs/source/best_practice/flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LazyLLM中定义了大量的数据流组件,用于让您像搭积木一样,

定义和API文档
============
数据流的定义和基本使用方法如 :ref:`apo.flow` 中所述
数据流的定义和基本使用方法如 :ref:`api.flow` 中所述

pipeline
============
Expand Down Expand Up @@ -184,6 +184,7 @@ AutoCapture(试验特性)
为了进一步简化代码的复杂性,我们上线了自动捕获with块内定义的变量的能力,示例如下:

.. code-block:: python
from lazyllm import pipeline, _0
with pipeline(auto_capture=True) as p:
p1 = f1
Expand Down Expand Up @@ -211,6 +212,7 @@ parallel的所有组件共享输入,并将结果合并输出。 ``parallel``
为了进一步简化流程的复杂性,不引入过多的匿名函数,parallel的结果可以做一个简单的后处理(目前仅支持 ``sum`` 或 ``asdict``),然后传给下一级。下面给出一个例子:

.. code-block:: python
from lazyllm import parallel
def f1(input): return input
Expand Down Expand Up @@ -240,6 +242,7 @@ parallel的所有组件共享输入,并将结果合并输出。 ``parallel``
``parallel`` 默认是多线程并行执行的,在一些特殊情况下,可以根据需求改成顺序执行。下面给出一个例子:

.. code-block:: python
from lazyllm import parallel
def f1(input): return input
Expand All @@ -257,4 +260,4 @@ parallel的所有组件共享输入,并将结果合并输出。 ``parallel``
小结
============
本篇着重讲解了 ``pipeline`` 和 ``parallel``,相信您对如何利用LazyLLM的flow搭建复杂的应用已经有了初步的认识,其他的数据流组件不做过多赘述,您可以参考 :ref:`apo.flow` 来获取他们的使用方式。
本篇着重讲解了 ``pipeline`` 和 ``parallel``,相信您对如何利用LazyLLM的flow搭建复杂的应用已经有了初步的认识,其他的数据流组件不做过多赘述,您可以参考 :ref:`api.flow` 来获取他们的使用方式。
4 changes: 4 additions & 0 deletions docs/source/best_practice/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
LazyLLM的顶层核心概念:模块
=========================


29 changes: 28 additions & 1 deletion docs/source/best_practice/prompt.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,29 @@
Prompter
------------
============

为了让您在不同的线上模型和不同的本地模型都能获得一致的使用体验,在微调和推理中也能获得一致的使用体验,我们定义了Prompter

LazyLLM Prompter的设计思路
-------------------------

基本概念说明
^^^^^^^^^^^^^

设计思路
^^^^^^^^^^^^^


Prompter示例
-------------------------

Prompter的使用和定义方式
^^^^^^^^^^^^^^^^^^^^^^^^^

和OnlineChatModule一起使用
^^^^^^^^^^^^^^^^^^^^^^^^^

和TrainableModule一起使用
^^^^^^^^^^^^^^^^^^^^^^^^^

LazyLLM中内置的场景Prompt
-------------------------
33 changes: 26 additions & 7 deletions docs/source/best_practice/rag.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
RAG
--------
==================

检索增强生成(Retrieval-augmented Generation, RAG)是当前备受关注的大模型前沿技术之一。其工作原理是,当模型需要生成文本或回答问题时,首先会从一个庞大的文档集合中检索出相关的信息。这些检索到的信息随后用于指导生成过程,从而显著提高生成文本的质量和准确性。通过这种方式,RAG能够在处理复杂问题时提供更加精确和有意义的回答,是自然语言处理领域的重要进展之一。这种方法的优越性在于它结合了检索和生成的优势,使得模型不仅能够生成流畅的文本,还能基于真实数据提供有依据的回答。
本文展示了如何利用LazyLLM搭建自己的RAG应用,并随心所欲的增加召回策略。

RAG的原理简介
-------------------

用LazyLLM搭建你的第一个RAG应用
-------------------

基本的RAG
=============
+++++++++++++++++++


文档管理服务
=============
+++++++++++++++++++


替换为本地模型
=============
部署本地模型并使用
+++++++++++++++++++


多路召回
=============
+++++++++++++++++++


自定义parser
+++++++++++++++++++


微调你的模型
+++++++++++++++++++

线上模型的微调
^^^^^^^^^^^^^^^^

本地模型的微调
^^^^^^^^^^^^^^^^


=============
LazyLLM中RAG模块的设计思想
----------------------------
2 changes: 1 addition & 1 deletion docs/source/contribution/contribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
如果你非常善于处理冲突,那么可以使用 rebase 的方式来解决冲突,因为这能够保证你的 commit log 的整洁。如果你不太熟悉 ``rebase`` 的使用,那么可以使用 ``merge`` 的方式来解决冲突。

pull request规范
~~~~~~~~~
~~~~~~~~~~~~~~~~~

1. 一个 ``pull request`` 对应一个短期分支

Expand Down
2 changes: 2 additions & 0 deletions docs/source/user_guide/FAQ.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FAQ
============
6 changes: 3 additions & 3 deletions docs/source/user_guide/environment.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
环境依赖
=======
========

依赖及场景说明
~~~~~~~~~~
~~~~~~~~~~~~~

- 微调(基于alpaca-lora): datasets, deepspeed, faiss-cpu, fire, gradio, numpy, peft, torch, transformers
- 微调(基于collie): collie-lm, numpy, peft, torch, transformers, datasets, deepspeed, fire
Expand All @@ -11,7 +11,7 @@
- RAG: llama_index, llama-index-retrievers-bm25, llama-index-storage-docstore-redis, llama-index-vector-stores-redis, rank_bm25, redisvl, llama_index, llama-index-embeddings-huggingface

基础依赖
~~~~~~~
~~~~~~~~~~

- fastapi: FastAPI 是一个现代、快速(高性能)的Web框架,用于构建API,与Python 3.6+类型提示一起使用。
- loguru: Loguru 是一个Python日志库,旨在通过简洁、易用的API提供灵活的日志记录功能。
Expand Down

0 comments on commit e0a4236

Please sign in to comment.