@@ -43,11 +43,16 @@ environment and install the dependencies using the following command:
4343pip install -r requirements.txt
4444```
4545
46+ Depending on your hardware you may run into some issues when running the ` pip install ` command with the
47+ ` flash_attn ` package. In that case running ` FLASH_ATTENTION_SKIP_CUDA_BUILD=TRUE pip install flash-attn --no-build-isolation `
48+ could help you.
49+
4650In order to use the default LLM for this query, you'll need an account and an
47- API key from OpenAI specified as another environment variable :
51+ API key from OpenAI specified as a ZenML secret :
4852
4953``` shell
50- export OPENAI_API_KEY=< your-openai-api-key>
54+ zenml secret create llm-complete --openai_api_key=< your-openai-api-key>
55+ export ZENML_PROJECT_SECRET_NAME=llm-complete
5156```
5257
5358### Setting up Supabase
@@ -63,22 +68,15 @@ You'll want to save the Supabase database password as a ZenML secret so that it
6368isn't stored in plaintext. You can do this by running the following command:
6469
6570``` shell
66- zenml secret create supabase_postgres_db --password= " YOUR_PASSWORD"
71+ zenml secret update llm-complete -v ' {"supabase_password": " YOUR_PASSWORD", "supabase_user": "YOUR_USER", "supabase_host": "YOUR_HOST", "supabase_port": "YOUR_PORT"} '
6772```
6873
69- You'll then want to connect to this database instance by getting the connection
74+ You can get the user, host and port for this database instance by getting the connection
7075string from the Supabase dashboard.
7176
7277![ ] ( .assets/supabase-connection-string.png )
7378
74- You can use these details to populate some environment variables where the
75- pipeline code expects them:
76-
77- ``` shell
78- export ZENML_POSTGRES_USER=< your-supabase-user>
79- export ZENML_POSTGRES_HOST=< your-supabase-host>
80- export ZENML_POSTGRES_PORT=< your-supabase-port>
81- ```
79+ In case supabase is not an option for you, you can use a different database as the backend.
8280
8381### Running the RAG pipeline
8482
@@ -151,16 +149,17 @@ documentation](https://docs.zenml.io/v/docs/stack-components/annotators/argilla)
151149will guide you through the process of connecting to your instance as a stack
152150component.
153151
154- ### Finetune the embeddings
155-
156- To run the pipeline for finetuning the embeddings, you can use the following
157- commands:
152+ Please use the secret from above to track all the secrets. Here we are also
153+ setting a Huggingface write key. In order to make the rest of the pipeline work for you, you
154+ will need to change the hf repo urls to a space you have permissions to.
158155
159- ``` shell
160- pip install -r requirements-argilla.txt # special requirements
161- python run.py --embeddings
156+ ``` bash
157+ zenml secret update llm-complete -v ' {"argilla_api_key": "YOUR_ARGILLA_API_KEY", "argilla_api_url": "YOUR_ARGILLA_API_URL", "hf_token": "YOUR_HF_TOKEN"}'
162158```
163159
160+
161+ ### Finetune the embeddings
162+
164163As with the previous pipeline, you will need to have set up and connected to an Argilla instance for this
165164to work. Please follow the instructions in the [ Argilla
166165documentation] ( https://docs.argilla.io/latest/getting_started/quickstart/ )
@@ -170,6 +169,17 @@ documentation](https://docs.zenml.io/v/docs/stack-components/annotators/argilla)
170169will guide you through the process of connecting to your instance as a stack
171170component.
172171
172+ The pipeline assumes that your argilla secret is stored within a ZenML secret called ` argilla_secrets ` .
173+ ![ Argilla Secret] ( .assets/argilla_secret.png )
174+
175+ To run the pipeline for finetuning the embeddings, you can use the following
176+ commands:
177+
178+ ``` shell
179+ pip install -r requirements-argilla.txt # special requirements
180+ python run.py --embeddings
181+ ```
182+
173183* Credit to Phil Schmid for his [ tutorial on embeddings finetuning with Matryoshka
174184loss function] ( https://www.philschmid.de/fine-tune-embedding-model-for-rag ) which we adapted for this project.*
175185
0 commit comments