Skip to content

Commit

Permalink
example update
Browse files Browse the repository at this point in the history
  • Loading branch information
pchalasani committed Jan 2, 2024
1 parent 942b6ff commit 6e030b2
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions examples/docqa/rag-local-simple.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
"""
RAG example using a local LLM, with ollama
"""
import os
import langroid as lr
import langroid.language_models as lm
from langroid.agent.special.doc_chat_agent import DocChatAgent, DocChatAgentConfig

os.environ["TOKENIZERS_PARALLELISM"] = "false"
# (1) Mac: Install latest ollama, then do this:
# ollama pull mistral:7b-instruct-v0.2-q4_K_M
Expand All @@ -15,6 +8,18 @@
# pip install langroid[litellm], or if you use the `pyproject.toml` in this repo
# you can simply say `poetry install`
# (3) Run like this:
python3 examples/docqa/rag-local-simple.py
"""
import os
import langroid as lr
import langroid.language_models as lm
from langroid.agent.special.doc_chat_agent import DocChatAgent, DocChatAgentConfig

os.environ["TOKENIZERS_PARALLELISM"] = "false"

llm = lm.OpenAIGPTConfig(
chat_model="litellm/ollama/mistral:7b-instruct-v0.2-q4_K_M",
completion_model="litellm/ollama/mistral:7b-instruct-v0.2-q4_K_M",
Expand Down

0 comments on commit 6e030b2

Please sign in to comment.