This is an example application to demenstrate Retrieval Augmented Generation (RAG) in Traditional Chinese.
We used FastAPI as the interface, LangChain as the application framework, and OpenAI-API as the LLM and embedding model provider. That is to say, you will need a valid OPENAI-API-KEY to run this example on its default settings. You can modify the code to use alternative models.
To avoid copyright issues, this demo provided RAG of the Bible. The 《國語和合本聖經》 is a translation of the English Revised Version of the Bible published in 1919 and is currently belong to the public domain.
- Clone this repo
git clone https://github.com/tingsyo/example_rag.git
- Install dependecies
pip install -r requirements.txt
- Run the app
Use the Bible for RAG by default:
python app.py
Or, you may specify your own vectorstore:
python app.py --vectorstore_path <PATH_TO_VECTORSTORE>
We also provide an example script to convert all pdf files in the specified directory into a vectorstore. Usage:
python create_vectorstore_from_pdfs.py --data_path <PATH_TO_PDF_FILES> --output_path <PATH_TO_OUTPUT_VECTORSTORE>