Colab requirements

#13 · closed · 2 comments

View on GitHub ↗

alipour97

Hi. I can't install requirements on google colab. it makes runtime disconnect. it works on my local PC but not in colab

Comments

GiovanniPasq

Hi, I was not able to reproduce a disconnection error on my end (can you give me more details?). Instead, I ran into dependency conflicts caused by `gradio`, `ipykernel`, and `ragas`. I'd suggest trying to remove the above packages and use the default installed version or find a compatible version with Colab and run the notebook again. Let me know if this helps!

alipour97

Thanks for your response. Yes. that was the problem. also it doesn't need `matplotlib `as version mismatch. you can add this line to notebook as notebook doesn't import requirements.txt. `!pip install fastembed==0.8.0 langchain-huggingface==1.2.2 langchain-ollama==1.1.0 langchain-qdrant==1.1.0 langchain-text-splitters==1.1.2 langfuse==4.9.1 langgraph==1.2.6 pymupdf4llm==1.27.2.3 seaborn==0.13.2 sentence-transformers==5.6.0 tiktoken==0.13.0 langchain_ollama langchain_google_genai` also I suggest you to use google drive for storing docs, so later, if a user re run the code, doesn't need to run markdown and embedding again. ``` from google.colab import drive import os IN_COLAB = 'COLAB_GPU' in os.environ or 'COLAB_RELEASE_TAG' in os.environ if IN_COLAB: drive.mount('/content/drive') base_dir = '/content/drive/MyDrive/RAG/' DOCS_DIR = base_dir + "docs" if IN_COLAB else "../docs" # Directory containing your pdf files MARKDOWN_DIR = base_dir + "markdown_docs" if IN_COLAB else "../markdown_docs" # Directory containing the pdfs converted to markdown PARENT_STORE_PATH = base_dir + "parent_store" if IN_COLAB else "../parent_store" # Directory for parent chunk JSON files QDRANT_DB_PATH = "qdrant_db" if IN_COLAB else "../qdrant_db" CHILD_COLLECTION = "document_child_chunks" RETRIEVAL_SCORE_THRESHOLD = 0.4 DEFAULT_RETRIEVAL_K = 7 CHILD_CHUNK_SEPARATOR = "\n\n<CHILD_CHUNK_BOUNDARY>\n\n" os.makedirs(DOCS_DIR, exist_ok=True) os.makedirs(MARKDOWN_DIR, exist_ok=True) os.makedirs(PARENT_STORE_PATH, exist_ok=True) ```