Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# rag-tutorial-v2

## Running with OLLAMA

1. Install the following packages:
```shell
$ pip3 install langchain
$ pip3 install chromadb
$ pip3 install pypdf
$ pip3 install pytest
$ pip3 install langchain-community
$ pip3 install -U langchain-chroma
```

2. Make sure you have ollama on your machine by checking out the instructions in [Ollama Github](https://github.com/ollama/ollama)

3. Once ollama has been downloaded, start the server in another terminal window:
```shell
$ ollama serve
```

4. Pull the models needed:
```shell
$ ollama pull nomic-embed-text
$ ollama pull mistral
```

5. Run the program. Below is an example:
```shell
$ python3 query_data.py "how much total money does a player start with in Monopoly?"
```

The return answer should be shown in the terminal.


8 changes: 4 additions & 4 deletions get_embedding_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@


def get_embedding_function():
embeddings = BedrockEmbeddings(
credentials_profile_name="default", region_name="us-east-1"
)
# embeddings = OllamaEmbeddings(model="nomic-embed-text")
#embeddings = BedrockEmbeddings(
# credentials_profile_name="default", region_name="us-east-1"
#)
embeddings = OllamaEmbeddings(model="nomic-embed-text")
return embeddings
3 changes: 2 additions & 1 deletion query_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
from langchain.vectorstores.chroma import Chroma
#from langchain.vectorstores.chroma import Chroma
from langchain_chroma import Chroma
from langchain.prompts import ChatPromptTemplate
from langchain_community.llms.ollama import Ollama

Expand Down