Help with starting local langroid #515
Unanswered
begins-rag
asked this question in
Q&A
Replies: 2 comments 2 replies
-
@begins-rag this looks like it may be trying to use an OpenAI embedding model (for RAG in DocChatAgent). Maybe you can try explicitly setting the First make sure to install the appropriate extras:
Then do this in your code: os.environ["TOKENIZERS_PARALLELISM"] = "false" # shutting up warnings from hf transformers
hf_embed_config = lr.embedding_models.SentenceTransformerEmbeddingsConfig(
model_type="sentence-transformer",
model_name="BAAI/bge-large-en-v1.5",
)
agent_config = DocChatAgentConfig(
llm=llm_config,
system_message="You are helpful but concise",
doc_paths=["examples/docqa/docs/1706.03762.pdf"],
parsing=ParsingConfig(
pdf=PdfParsingConfig(
library="unstructured",
)
),
vecdb=lr.vector_store.QdrantDBConfig(
collection_name="doc-chat-qdrantdb",
replace_collection=True,
storage_path=".qdrantdb/data/",
embedding=hf_embed_config,
)
) |
Beta Was this translation helpful? Give feedback.
2 replies
-
@begins-rag there was a new release that should resolve your issue with torch. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi I am a newbie trying out and playing with langroid as I wanted to explore something else other than langchain. I was messing around with the local_chats.py and I have come to a wall where I keep facing the error below:
I am hoping to understand why is this so considering I can run it as a normal chatbot but face it as soon as I use DocChatAgentConfig? and how to rectify it if possible. Below is my full code:
import langroid.language_models as lm
import langroid as lr
from langroid.agent.special.doc_chat_agent import DocChatAgent, DocChatAgentConfig
from langroid.parsing.parser import ParsingConfig, PdfParsingConfig, Splitter
llm_config = lm.OpenAIGPTConfig(
chat_model="ollama/llama3",
chat_context_length=8000,
)
agent_config = DocChatAgentConfig(
llm=llm_config,
system_message="You are helpful but concise",
doc_paths=["examples/testdata/SGIsago(2020).pdf"],
parsing=ParsingConfig(
pdf=PdfParsingConfig(
library="unstructured",
)
),
)
agent = DocChatAgent(agent_config)
task = lr.Task(agent, interactive=True)
task.run() # for an interactive chat loop
Beta Was this translation helpful? Give feedback.
All reactions