Skip to content
Open
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
25 changes: 25 additions & 0 deletions rag-with-dockling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@ This project leverages LlamaIndex and IBM's Docling for RAG over excel sheets. Y

---

## 🐞 Issue You may face
### 1. Pickle Error with `@st.cache_resource`
The app might fail with: `An error occurred: cannot pickle 'classmethod' object`

> ✅ **Solution**: Don’t cache non-picklable objects like the Ollama client or embeddings. Instead, store them in Streamlit's session state:
> ```python
> if "llm_client" not in st.session_state:
> st.session_state.llm_client = Ollama(model="llama3.2")
> ```

### 2. App Extremely Slow (incase Used another Large Model)
This often happens due to high memory usage. `ollama` was observed using 10+ GB RAM on an 8 GB Mac, leading to heavy swapping. Large embedding models like `bge-large-en-v1.5` also consume significant memory.

> ✅ **Solution**:
> * **Use smaller Ollama models**:
> * `qwen2:1.5b`
> * `llama3.2:1b`
> * `mistral:7b-instruct-q4_K_M`
> * **Use smaller embeddings**:
> ```python
> HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5")
> ```

---

## 📬 Stay Updated with Our Newsletter!
**Get a FREE Data Science eBook** 📖 with 150+ essential lessons in Data Science when you subscribe to our newsletter! Stay in the loop with the latest tutorials, insights, and exclusive resources. [Subscribe now!](https://join.dailydoseofds.com)

Expand Down