From c83914f3077aaf00e1d858da1806c4d779b98ad2 Mon Sep 17 00:00:00 2001 From: brunesto Date: Wed, 4 Dec 2024 09:46:40 +0100 Subject: [PATCH 1/2] pysqlite3-binary fix --- app.py | 7 +++++++ requirements/requirements.txt | 1 + 2 files changed, 8 insertions(+) diff --git a/app.py b/app.py index 9561600..ea881b5 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,13 @@ import os import tempfile + +#https://stackoverflow.com/questions/76958817/streamlit-your-system-has-an-unsupported-version-of-sqlite3-chroma-requires-sq +__import__('pysqlite3') +import sys +sys.modules['sqlite3'] = sys.modules.pop('pysqlite3') + + import chromadb import ollama import streamlit as st diff --git a/requirements/requirements.txt b/requirements/requirements.txt index b59f150..f26b205 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -4,3 +4,4 @@ sentence-transformers==3.3.1 # CrossEncoder Re-ranking streamlit==1.40.1 # Application UI PyMuPDF==1.24.14 # PDF Document loader langchain-community==0.3.7 # Utils for text splitting +pysqlite3-binary==0.5.4 From d73b92524e0aa36d8b27b9b9022b9163adaafa08 Mon Sep 17 00:00:00 2001 From: brunesto Date: Fri, 6 Dec 2024 09:30:04 +0100 Subject: [PATCH 2/2] disable ruff rule E402 --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index ea881b5..991195a 100644 --- a/app.py +++ b/app.py @@ -3,12 +3,12 @@ #https://stackoverflow.com/questions/76958817/streamlit-your-system-has-an-unsupported-version-of-sqlite3-chroma-requires-sq +# ruff: noqa: E402 __import__('pysqlite3') import sys sys.modules['sqlite3'] = sys.modules.pop('pysqlite3') - - import chromadb + import ollama import streamlit as st from chromadb.utils.embedding_functions.ollama_embedding_function import (