From 04e2ec81d86c0398c001f7bb7d530a0e8bbda49e Mon Sep 17 00:00:00 2001 From: Juan Perez Tejada Date: Fri, 8 Dec 2023 20:57:29 -0600 Subject: [PATCH] Solve pylint complains --- app.py | 12 +++++++++++- wk_flow_requirements.txt | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index cce7025..36775d0 100644 --- a/app.py +++ b/app.py @@ -1,15 +1,16 @@ """ A simple example of Streamlit. """ from datetime import datetime as Date import textwrap +import os import tiktoken import chromadb from chromadb.utils.embedding_functions import OpenAIEmbeddingFunction import fitz import streamlit as st import openai -import os from dotenv import load_dotenv from openai import OpenAI +from langchain.vectorstores import Chroma load_dotenv() @@ -94,3 +95,12 @@ chroma_client.delete_collection(collection.name) except AttributeError: st.error("Collection erased.") + +if chroma_client.get_collection(collection.name) is not None: + langchain_agent = Chroma(client=chroma_client, + collection_name=collection.name, + embedding_function=embedding_function + ) + + + diff --git a/wk_flow_requirements.txt b/wk_flow_requirements.txt index be29b87..fd84690 100644 --- a/wk_flow_requirements.txt +++ b/wk_flow_requirements.txt @@ -1,4 +1,6 @@ streamlit pymupdf +openai +tiktoken pylint chromadb>='0.4.18'