Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiyiXia committed Nov 8, 2024
1 parent fd0346e commit 44a1880
Show file tree
Hide file tree
Showing 115 changed files with 9,968 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
10 changes: 10 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
install the required pkgs:
```
pip install -r requirements.txt
```


to host the webpages locally:
```
python -m http.server
```
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx
myst-nb
furo
6 changes: 6 additions & 0 deletions docs/source/API/abc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Abstract Class
==============

.. toctree::
abc/inference
abc/finetune
6 changes: 6 additions & 0 deletions docs/source/API/abc/finetune.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Finetune
========

.. toctree::
finetune/embedder
finetune/reranker
9 changes: 9 additions & 0 deletions docs/source/API/abc/finetune/embedder.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Embedder
========

.. toctree::
embedder/AbsArguments
embedder/AbsDataset
embedder/AbsModeling
embedder/AbsTrainer
embedder/AbsRunner
6 changes: 6 additions & 0 deletions docs/source/API/abc/finetune/embedder/AbsArguments.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AbsArguments
============

.. autoclass:: FlagEmbedding.abc.finetune.reranker.AbsRerankerModelArguments

.. autoclass:: FlagEmbedding.abc.finetune.reranker.AbsRerankerDataArguments
53 changes: 53 additions & 0 deletions docs/source/API/abc/finetune/embedder/AbsDataset.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
==========
AbsDataset
==========

AbsEmbedderTrainDataset
=======================

.. autoclass:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderTrainDataset

Methods
-------

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderTrainDataset._load_dataset

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderTrainDataset._shuffle_text

AbsEmbedderCollator
===================

.. autoclass:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderCollator

AbsEmbedderSameDatasetTrainDataset
==================================

.. autoclass:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderSameDatasetTrainDataset

Methods
-------

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderSameDatasetTrainDataset.refresh_epoch

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderSameDatasetTrainDataset._load_dataset

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderSameDatasetTrainDataset._get_file_batch_size

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderSameDatasetTrainDataset._get_train_group_size

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderSameDatasetTrainDataset._create_batch_data

AbsEmbedderSameDatasetCollator
==============================

.. autoclass:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderSameDatasetCollator

EmbedderTrainerCallbackForDataRefresh
=====================================

.. autoclass:: FlagEmbedding.abc.finetune.embedder.EmbedderTrainerCallbackForDataRefresh

Methods
-------

.. automethod:: FlagEmbedding.abc.finetune.embedder.EmbedderTrainerCallbackForDataRefresh.on_epoch_end
41 changes: 41 additions & 0 deletions docs/source/API/abc/finetune/embedder/AbsModeling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
===========
AbsModeling
===========

AbsEmbedderModel
================

.. autoclass:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel

Methods
-------

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel.encode

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel.compute_loss

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel.compute_score

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel.save

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel.get_local_score

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel.compute_local_score

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel.forward

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel.distill_loss

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel._compute_no_in_batch_neg_loss

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel._compute_in_batch_neg_loss

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel._compute_cross_device_neg_loss

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModel._dist_gather_tensor


EmbedderOutput
==============

.. autoclass:: FlagEmbedding.abc.finetune.embedder.EmbedderOutput
21 changes: 21 additions & 0 deletions docs/source/API/abc/finetune/embedder/AbsRunner.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
=========
AbsRunner
=========

AbsEmbedderTrainer
==================

.. autoclass:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderRunner

Methods
-------

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderRunner.load_tokenizer_and_model

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderRunner.load_trainer

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderRunner.load_train_dataset

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderRunner.load_data_collator

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderRunner.run
13 changes: 13 additions & 0 deletions docs/source/API/abc/finetune/embedder/AbsTrainer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
==========
AbsTrainer
==========

AbsEmbedderTrainer
==================

.. autoclass:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderTrainer

Methods
-------

.. automethod:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderTrainer.compute_loss
9 changes: 9 additions & 0 deletions docs/source/API/abc/finetune/reranker.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Reranker
========

.. toctree::
reranker/AbsArguments
reranker/AbsDataset
reranker/AbsModeling
reranker/AbsTrainer
reranker/AbsRunner
6 changes: 6 additions & 0 deletions docs/source/API/abc/finetune/reranker/AbsArguments.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AbsArguments
============

.. autoclass:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderModelArguments

.. autoclass:: FlagEmbedding.abc.finetune.embedder.AbsEmbedderDataArguments
32 changes: 32 additions & 0 deletions docs/source/API/abc/finetune/reranker/AbsDataset.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
==========
AbsDataset
==========

AbsRerankerTrainDataset
=======================

.. autoclass:: FlagEmbedding.abc.finetune.reranker.AbsRerankerTrainDataset

Methods
-------

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerTrainDataset.create_one_example

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerTrainDataset._load_dataset

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerTrainDataset._shuffle_text

AbsRerankerCollator
===================

.. autoclass:: FlagEmbedding.abc.finetune.reranker.AbsRerankerCollator

AbsLLMRerankerTrainDataset
==========================

.. autoclass:: FlagEmbedding.abc.finetune.reranker.AbsLLMRerankerTrainDataset

AbsLLMRerankerCollator
======================

.. autoclass:: FlagEmbedding.abc.finetune.reranker.AbsLLMRerankerCollator
31 changes: 31 additions & 0 deletions docs/source/API/abc/finetune/reranker/AbsModeling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
===========
AbsModeling
===========

AbsRerankerModel
================

.. autoclass:: FlagEmbedding.abc.finetune.reranker.AbsRerankerModel

Methods
-------

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerModel.encode

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerModel.gradient_checkpointing_enable

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerModel.enable_input_require_grads

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerModel.forward

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerModel.compute_loss

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerModel.save

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerModel.save_pretrained


RerankerOutput
==============

.. autoclass:: FlagEmbedding.abc.finetune.reranker.RerankerOutput
21 changes: 21 additions & 0 deletions docs/source/API/abc/finetune/reranker/AbsRunner.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
=========
AbsRunner
=========

AbsRerankerTrainer
==================

.. autoclass:: FlagEmbedding.abc.finetune.reranker.AbsRerankerRunner

Methods
-------

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerRunner.load_tokenizer_and_model

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerRunner.load_trainer

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerRunner.load_train_dataset

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerRunner.load_data_collator

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerRunner.run
13 changes: 13 additions & 0 deletions docs/source/API/abc/finetune/reranker/AbsTrainer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
==========
AbsTrainer
==========

AbsRerankerTrainer
==================

.. autoclass:: FlagEmbedding.abc.finetune.reranker.AbsRerankerTrainer

Methods
-------

.. automethod:: FlagEmbedding.abc.finetune.reranker.AbsRerankerTrainer.compute_loss
6 changes: 6 additions & 0 deletions docs/source/API/abc/inference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Inference
=========

.. toctree::
inference/AbsEmbedder
inference/AbsReranker
Loading

0 comments on commit 44a1880

Please sign in to comment.