GRAG Overview
+GRAG provides an implementation of Retrieval-Augmented Generation that is completely open-sourced.
+diff --git a/cookbook/Basic-RAG/README.md b/cookbook/Basic-RAG/README.md index dd8f74c..be1807a 100644 --- a/cookbook/Basic-RAG/README.md +++ b/cookbook/Basic-RAG/README.md @@ -3,7 +3,7 @@ Welcome to the Basic RAG Cookbook! This repository is dedicated to showcasing how to utilize the Retrieval-Augmented Generation (RAG) model for various applications using custom and few-shot prompts. For in depth understanding of RAG pipelines, chains, and prompts -check [RAG-Piplines.md](https://github.com/arjbingly/Capstone_5/blob/main/projects/Basic-RAG/RAG-Piplines.md) +check [RAG-Pipelines.md](https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md) ### Contents: diff --git "a/documentation/Sphinx - How to get started\357\200\277.md" "b/documentation/Sphinx - How to get started\357\200\277.md" new file mode 100644 index 0000000..138726c --- /dev/null +++ "b/documentation/Sphinx - How to get started\357\200\277.md" @@ -0,0 +1,150 @@ +# Sphinx - How to get started? + +## Prereqs + +- You have proper documentation for your code. This includes doc strings. +- Make sure that your doc strings follow a standard, eg. PEP, Google, Numpy, etc. +- Highly recommended to use a linter for both your code and docs. I use Ruff. + +## 1. Install Sphinx + +*refer: https://www.sphinx-doc.org/en/master/usage/installation.html* + +- **for Ubuntu/Debian** : `sudo apt install python3-sphinx` + +## 1.1 Folder Structure (Recommended) + +I like my docs as a separate folder in `src`. Therefore I create a new directory `docs`. Move here for the next step. + +``` +├── src +│ ├── build +│ ├── package_dir +│ │ ├── __init__.py +│ │ ├── module_1.py +│ │ ├── module_2.py +│ │ ├── subpackage_dir +│ │ │ ├── __init__.py +│ │ │ ├── module_1.py +│ │ │ ├── module_2.py +├── other directories and files not documented +│ ├── css +│ │ ├── **/*.css +│ ├── images +│ ├── js +│ ├── index.html +├── pyproject.toml +├── requirements.txt +├── package-lock.json +└── .gitignore + +``` + +## 2. Quickstart + +Run: + +``` +sphinx-quickstart +``` + +This will ask you the following: + +1. **Do you wanna separate your build and source?** N, Since I recommend a folder structure with a separate docs + directory. +2. Name of Project +3. Author Name +4. Project Release +5. Project Language + +If run successfully this will create a `conf.py` file, the make files and folders like `_build`, `_static`, +and `_template`. + +## 3. Extract docs + +Move to `src` dir. +Run: + +``` +sphinx-apidoc -o docs package_dir +``` + +Note that: here `-o` flag is the output folder, in our structure it is the `docs` directory, and `package_dir` is the +directory with all the code you want to document. + +This will create `.rst` files for each Python module. + +## 4. Conf.py changes + +The `conf.py` file is in `docs` folder. +You can see all the details you specified in the `quickstart` here. + +## 4.1 OS Syspath Changes + +Add the following to the beginning of `conf.py`. + +``` +import os +import sys +sys.path.insert(0, os.path.abspath("../package_dir")) +``` + +*Note that this assumes the above-mentioned folder structure, if you have a different structure, make sure to point it +to the source code. * + +## 4.3 Extensions + +Sphinx has a lot of useful extensions. These should be added to the `extensions` tag. Some of the extensions I use are: + +1. `sphinx.ext.autodoc` - This extension automatically takes doc strings. +2. `sphinx.ext.linkcode` (Optional) - This extension provides a link to the GitHub code. *(Note that this extension + requires other configs. Refer to Sphinx extension documentation for more details.)* +3. `sphinx.ext.viewcode` (Optional) - This extension is similar to the above extension, instead of linking the code to + GitHub, it displays the code in a static webpage. +4. `sphinx.ext.napoleon` (Optional) - Since we use Google doc-string standard, this is an essential extension. + +## 4.2 Theme (Optional) + +I use a Sphinx theme, which can be installed by running, + +``` +pip install sphinx-rtd-theme +``` + +Change the `html_theme` tag in the `conf.py` to `sphinx_rtd_theme`. + +You can find more themes at various sources like `www.sphinx-themes.org/`, +`https://sphinxthemes.com`, etc. + +## 5 Building the docs + +To finally generate the docs run the following command from the `docs` directory. + +``` +make html +``` + +This will create a `build` directory, where you can find the html files. Opening the `index.html` shows you the homepage +of your docs. + +## 6.1 Adding other pages (Optional) + +To add other pages to your sphinx website, you just have to create `.rst` reStructuredText files in the appropriate +location and add them to your `index.rst` or to the `toctree` of a file already mentioned in `index.rst`. + +For more instructions on defining document structure refer +[Defining Docuement Structure](https://www.sphinx-doc.org/en/master/usage/quickstart.html#defining-document-structure) + +For instructions on how to format reStructuredText refer to +[reStructuredText Basics](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html) + +## 6.2 Adding examples (Optional) + +TODO + +- [https://sphinx-gallery.github.io/stable/index.html]() + +### References + +- [https://www.sphinx-doc.org/en/master/usage/quickstart.html]() +- [https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/]() diff --git a/llm_quantize/README.md b/llm_quantize/README.md index fe2a938..18660a8 100644 --- a/llm_quantize/README.md +++ b/llm_quantize/README.md @@ -1,15 +1,14 @@ ## Model Quantization -This module provides interactive way to quantize your model. -To quantize model: +This module provides an interactive way to quantize your model. +To quantize model, run: `python -m grag.quantize.quantize` -After running the above command user will be prompted with following: +After running the above command, user will be prompted with the following: -- Path where user want to clone [llama.cpp](!https://github.com/ggerganov/llama.cpp) repo. +- Path where user wants to clone [llama.cpp](!https://github.com/ggerganov/llama.cpp) repo - If user wants us to download model from [HuggingFace](!https://huggingface.co/models) or user has model downloaded - locally. -- For former, user will be prompted to provide repo path from HuggingFace. -- In case of later, user will be instructed to copy the model and input the name of model directory. -- Finally, user will be prompted to enter quantization (recommended Q5_K_M or Q4_K_M, etc.). Check - more [here](!https://github.com/ggerganov/llama.cpp/blob/master/examples/quantize/quantize.cpp#L19). \ No newline at end of file + locally + - For the former, user will be prompted to provide repo path from HuggingFace + - For the latter, user will be instructed to copy the model and input the name of model directory +- Finally, user will be prompted to enter quantization (recommended Q5_K_M or Q4_K_M, etc.). For more details, check [here](!https://github.com/ggerganov/llama.cpp/blob/master/examples/quantize/quantize.cpp#L19). diff --git a/src/docs/_build/doctrees/get_started.introduction.doctree b/src/docs/_build/doctrees/get_started.introduction.doctree new file mode 100644 index 0000000..3322b98 Binary files /dev/null and b/src/docs/_build/doctrees/get_started.introduction.doctree differ diff --git a/src/docs/_build/html/_sources/get_started.introduction.rst.txt b/src/docs/_build/html/_sources/get_started.introduction.rst.txt new file mode 100644 index 0000000..fbfe17e --- /dev/null +++ b/src/docs/_build/html/_sources/get_started.introduction.rst.txt @@ -0,0 +1,8 @@ +GRAG Overview +============= + +GRAG provides an implementation of Retrieval-Augmented Generation that is completely open-sourced. + +Retrieval-Augmented Generation +################### + diff --git a/src/docs/_build/html/get_started.introduction.html b/src/docs/_build/html/get_started.introduction.html new file mode 100644 index 0000000..33ceb8d --- /dev/null +++ b/src/docs/_build/html/get_started.introduction.html @@ -0,0 +1,131 @@ + + +
+ + + +