-
Notifications
You must be signed in to change notification settings - Fork 571
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
115 changed files
with
9,968 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sphinx | ||
myst-nb | ||
furo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Abstract Class | ||
============== | ||
|
||
.. toctree:: | ||
abc/inference | ||
abc/finetune |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Finetune | ||
======== | ||
|
||
.. toctree:: | ||
finetune/embedder | ||
finetune/reranker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Inference | ||
========= | ||
|
||
.. toctree:: | ||
inference/AbsEmbedder | ||
inference/AbsReranker |
Oops, something went wrong.